This repository was archived by the owner on Nov 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-plugins.php
More file actions
62 lines (49 loc) · 1.88 KB
/
Copy pathsingle-plugins.php
File metadata and controls
62 lines (49 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* Page template for the single Plugins Post Type item
*
* @since 3.0
*/
// List of shortcodes I want removed
$rs = array( 'portfolio', 'faq', 'ac-testimonials', 'ac-flexslider', 'button', 'box' );
foreach ($rs as $s ) {
remove_shortcode( $s );
}
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
remove_action( 'genesis_after_post', 'genesis_do_author_box_single' );
add_action( 'get_header', 'arconix_change_genesis_sidebar' );
add_filter( 'arconix_plugins_content_filter', 'arconix_single_plugin_filter' );
/**
* Customize the content shown on this page
*
* @since 3.0
* @param string $content
* @return string $content
*/
function arconix_single_plugin_filter( $content ) {
$custom = get_post_custom();
isset( $custom["_acpl_slug"][0] )? $slug = $custom["_acpl_slug"][0] : $slug = '';
// Bail if $slug is not defined
if( ! $slug ) return $content;
// Pass the slug into the WP API to get the data we need
$details = unserialize( ARCONIX_PLUGINS::get_wporg_custom_plugin_data( $slug ) );
// Bail if $details isn't defined
if( ! $details ) return $content;
$sections = $details->sections;
$description = $sections['description'];
$installation = $sections['installation'];
$screenshots = $sections['screenshots'];
$faq = $sections['faq'];
$changelog = $sections['changelog'];
// Our page content
$content = '[tabs]';
$content .= '[tab title="Description"]' . $description . '[/tab]';
$content .= '[tab title="Screenshots"]' . $screenshots . '[/tab]';
$content .= '[tab title="Installation"]' . $installation . '[/tab]';
$content .= '[tab title="FAQ"]' . $faq . '[/tab]';
$content .= '[tab title="Changelog"]' . $changelog . '[/tab]';
$content .= '[/tabs]';
return $content;
}
genesis();