@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | protected $_aBuiltInRootMenuSlugs = array( |
31 | 31 | // All keys must be lower case to support case insensitive look-ups. |
32 | 32 | 'dashboard' => 'index.php', |
33 | - 'sites' => 'sites.php', // not work |
|
34 | - 'themes' => 'themes.php', // not work |
|
33 | + 'sites' => 'sites.php', // not work |
|
34 | + 'themes' => 'themes.php', // not work |
|
35 | 35 | 'plugins' => 'plugins.php', |
36 | 36 | 'users' => 'users.php', |
37 | 37 | 'settings' => 'settings.php', |
38 | - 'updates' => 'update-core.php', // does not work |
|
38 | + 'updates' => 'update-core.php', // does not work |
|
39 | 39 | ); |
40 | 40 | |
41 | 41 | /** |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | * @param string $sTextDomain (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: `admin-page-framework`. |
56 | 56 | * @return void returns nothing. |
57 | 57 | */ |
58 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ){ |
|
58 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_network', $sTextDomain = 'admin-page-framework' ) { |
|
59 | 59 | |
60 | - if ( ! $this->_isInstantiatable() ) { |
|
60 | + if ( !$this->_isInstantiatable() ) { |
|
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | $sCallerPath = $sCallerPath |
67 | 67 | ? $sCallerPath |
68 | - : AdminPageFramework_Utility::getCallerScriptPath( __FILE__ ); // this is important to attempt to find the caller script path here when separating the library into multiple files. |
|
68 | + : AdminPageFramework_Utility::getCallerScriptPath( __FILE__ ); // this is important to attempt to find the caller script path here when separating the library into multiple files. |
|
69 | 69 | |
70 | 70 | $this->oProp = new AdminPageFramework_Property_NetworkAdmin( $this, $sCallerPath, get_class( $this ), $sOptionKey, $sCapability, $sTextDomain ); |
71 | 71 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | protected function _isInstantiatable() { |
83 | 83 | |
84 | - if ( isset( $GLOBALS['pagenow'] ) && 'admin-ajax.php' === $GLOBALS['pagenow'] ) { |
|
84 | + if ( isset( $GLOBALS[ 'pagenow' ] ) && 'admin-ajax.php' === $GLOBALS[ 'pagenow' ] ) { |
|
85 | 85 | return false; |
86 | 86 | } |
87 | 87 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @param mixed $vDefault the default value that will be returned if nothing is stored. |
126 | 126 | * @return mixed If the field ID is not specified. |
127 | 127 | */ |
128 | - static public function getOption( $sOptionKey, $asKey=null , $vDefault=null ) { |
|
128 | + static public function getOption( $sOptionKey, $asKey = null, $vDefault = null ) { |
|
129 | 129 | return AdminPageFramework_WPUtility::getSiteOption( $sOptionKey, $asKey, $vDefault ); |
130 | 130 | } |
131 | 131 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param string $sTextDomain (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: `admin-page-framework`. |
56 | 56 | * @return void returns nothing. |
57 | 57 | */ |
58 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ){ |
|
58 | + public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ) { |
|
59 | 59 | |
60 | 60 | if ( ! $this->_isInstantiatable() ) { |
61 | 61 | return; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @since 3.7.10 |
80 | 80 | * @internal |
81 | - * @return null|object |
|
81 | + * @return AdminPageFramework_Link_network_admin_page |
|
82 | 82 | */ |
83 | 83 | protected function _getLinkObject() { |
84 | 84 | return new AdminPageFramework_Link_network_admin_page( $this->oProp, $this->oMsg ); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @since 3.7.10 |
91 | 91 | * @internal |
92 | - * @return null|object |
|
92 | + * @return AdminPageFramework_PageLoadInfo_network_admin_page |
|
93 | 93 | */ |
94 | 94 | protected function _getPageLoadObject() { |
95 | 95 | return new AdminPageFramework_PageLoadInfo_network_admin_page( $this->oProp, $this->oMsg ); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @since 3.0.0 |
25 | 25 | * @deprecated DEVVER Use `AdminPageFramework_PageMetaBox` instead. |
26 | 26 | */ |
27 | - function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
27 | + function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
28 | 28 | |
29 | 29 | trigger_error( |
30 | 30 | sprintf( |
@@ -67,11 +67,11 @@ |
||
67 | 67 | */ |
68 | 68 | function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
69 | 69 | |
70 | - if ( empty( $asPageSlugs ) ) { |
|
70 | + if ( empty( $asPageSlugs ) ) { |
|
71 | 71 | return; |
72 | 72 | } |
73 | 73 | |
74 | - if ( ! $this->_isInstantiatable() ) { |
|
74 | + if ( ! $this->_isInstantiatable() ) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 |
@@ -65,13 +65,13 @@ |
||
65 | 65 | * @param string $sPriority The priority, either `high`, `core`, `default` or `low`. |
66 | 66 | * @param string $sCapability The capability. See <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Roles and Capabilities</a>. |
67 | 67 | */ |
68 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
68 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
69 | 69 | |
70 | 70 | if ( empty( $asPageSlugs ) ) { |
71 | 71 | return; |
72 | 72 | } |
73 | 73 | |
74 | - if ( ! $this->_isInstantiatable() ) { |
|
74 | + if ( !$this->_isInstantiatable() ) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @since 3.0.0 |
24 | 24 | */ |
25 | - public function enqueueStyles( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
25 | + public function enqueueStyles( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
26 | 26 | if ( method_exists( $this->oResource, '_enqueueStyles' ) ) { |
27 | 27 | return $this->oResource->_enqueueStyles( $aSRCs, $sPageSlug, $sTabSlug, $aCustomArgs ); |
28 | 28 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param array (optional) The argument array for more advanced parameters. |
39 | 39 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
40 | 40 | */ |
41 | - public function enqueueStyle( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
41 | + public function enqueueStyle( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
42 | 42 | if ( method_exists( $this->oResource, '_enqueueStyle' ) ) { |
43 | 43 | return $this->oResource->_enqueueStyle( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
44 | 44 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @since 2.1.5 |
50 | 50 | */ |
51 | - public function enqueueScripts( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
51 | + public function enqueueScripts( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
52 | 52 | if ( method_exists( $this->oResource, '_enqueueScripts' ) ) { |
53 | 53 | return $this->oResource->_enqueueScripts( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
54 | 54 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param array (optional) The argument array for more advanced parameters. |
65 | 65 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
66 | 66 | */ |
67 | - public function enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
67 | + public function enqueueScript( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
68 | 68 | if ( method_exists( $this->oResource, '_enqueueScript' ) ) { |
69 | 69 | return $this->oResource->_enqueueScript( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
70 | 70 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | * @param array (optional) The argument array for more advanced parameters. |
65 | 65 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
66 | 66 | */ |
67 | - public function enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
67 | + public function enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
68 | 68 | if ( method_exists( $this->oResource, '_enqueueScript' ) ) { |
69 | 69 | return $this->oResource->_enqueueScript( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
70 | 70 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | public function construct() { |
31 | 31 | |
32 | 32 | add_filter( |
33 | - 'options_' . $this->aArguments[ 'caller_id' ], |
|
33 | + 'options_'.$this->aArguments[ 'caller_id' ], |
|
34 | 34 | array( $this, '_replyToSanitizeSavedFormData' ), |
35 | 35 | 5 // high priority as it must be done eariler |
36 | 36 | ); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | // Extract the meta box field form data (options) from the page form data (options). |
56 | 56 | return $this->castArrayContents( |
57 | - $this->getDataStructureFromAddedFieldsets(), // form data structure generate from fieldsets |
|
57 | + $this->getDataStructureFromAddedFieldsets(), // form data structure generate from fieldsets |
|
58 | 58 | $aSavedFormData |
59 | 59 | ); |
60 | 60 |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @param string The text domain of the caller script. |
90 | 90 | * @return void |
91 | 91 | */ |
92 | - public function __construct( $sPostType, $aArguments=array(), $sCallerPath=null, $sTextDomain='admin-page-framework' ) { |
|
92 | + public function __construct( $sPostType, $aArguments = array(), $sCallerPath = null, $sTextDomain = 'admin-page-framework' ) { |
|
93 | 93 | |
94 | 94 | if ( empty( $sPostType ) ) { |
95 | 95 | return; |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | $this, |
100 | 100 | $this->_getCallerScriptPath( $sCallerPath ), |
101 | 101 | get_class( $this ), // class name |
102 | - 'publish_posts', // capability |
|
103 | - $sTextDomain, // text domain |
|
102 | + 'publish_posts', // capability |
|
103 | + $sTextDomain, // text domain |
|
104 | 104 | 'post_type' // structure type |
105 | 105 | ); |
106 | - $this->oProp->sPostType = AdminPageFramework_WPUtility::sanitizeSlug( $sPostType ); |
|
106 | + $this->oProp->sPostType = AdminPageFramework_WPUtility::sanitizeSlug( $sPostType ); |
|
107 | 107 | |
108 | 108 | // Post type argument array structure |
109 | 109 | // @see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments |
@@ -132,14 +132,14 @@ discard block |
||
132 | 132 | return $sCallerPath; |
133 | 133 | } |
134 | 134 | |
135 | - if ( ! is_admin() ) { |
|
135 | + if ( !is_admin() ) { |
|
136 | 136 | return null; |
137 | 137 | } |
138 | 138 | $_sPageNow = AdminPageFramework_Utility::getElement( $GLOBALS, 'pagenow' ); |
139 | 139 | if ( |
140 | 140 | in_array( |
141 | 141 | $_sPageNow, |
142 | - array( 'edit.php', 'post.php', 'post-new.php', 'plugins.php', 'tags.php', 'edit-tags.php', ) |
|
142 | + array( 'edit.php', 'post.php', 'post-new.php', 'plugins.php', 'tags.php', 'edit-tags.php',) |
|
143 | 143 | ) |
144 | 144 | ) { |
145 | 145 | return AdminPageFramework_Utility::getCallerScriptPath( __FILE__ ); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @package AdminPageFramework |
16 | 16 | * @subpackage PostType |
17 | 17 | */ |
18 | -abstract class AdminPageFramework_PostType extends AdminPageFramework_PostType_Controller { |
|
18 | +abstract class AdminPageFramework_PostType extends AdminPageFramework_PostType_Controller { |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * The constructor of the class object. |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function __construct( $sPostType, $aArguments=array(), $sCallerPath=null, $sTextDomain='admin-page-framework' ) { |
93 | 93 | |
94 | - if ( empty( $sPostType ) ) { |
|
94 | + if ( empty( $sPostType ) ) { |
|
95 | 95 | return; |
96 | 96 | } |
97 | 97 |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2016 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2016 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods for registering custom post types. |
@@ -18,84 +18,83 @@ discard block |
||
18 | 18 | abstract class AdminPageFramework_PostType extends AdminPageFramework_PostType_Controller { |
19 | 19 | |
20 | 20 | /** |
21 | - * The constructor of the class object. |
|
22 | - * |
|
23 | - * Registers necessary hooks and sets up internal properties. |
|
24 | - * |
|
25 | - * <h4>Example</h4> |
|
26 | - * <code>new APF_PostType( |
|
27 | - * 'apf_posts', // post type slug |
|
28 | - * array( |
|
29 | - * 'labels' => array( |
|
30 | - * 'name' => 'Demo', |
|
31 | - * 'all_items' => __( 'Sample Posts', 'admin-page-framework-demo' ), |
|
32 | - * 'singular_name' => 'Demo', |
|
33 | - * 'add_new' => __( 'Add New', 'admin-page-framework-demo' ), |
|
34 | - * 'add_new_item' => __( 'Add New APF Post', 'admin-page-framework-demo' ), |
|
35 | - * 'edit' => __( 'Edit', 'admin-page-framework-demo' ), |
|
36 | - * 'edit_item' => __( 'Edit APF Post', 'admin-page-framework-demo' ), |
|
37 | - * 'new_item' => __( 'New APF Post', 'admin-page-framework-demo' ), |
|
38 | - * 'view' => __( 'View', 'admin-page-framework-demo' ), |
|
39 | - * 'view_item' => __( 'View APF Post', 'admin-page-framework-demo' ), |
|
40 | - * 'search_items' => __( 'Search APF Post', 'admin-page-framework-demo' ), |
|
41 | - * 'not_found' => __( 'No APF Post found', 'admin-page-framework-demo' ), |
|
42 | - * 'not_found_in_trash' => __( 'No APF Post found in Trash', 'admin-page-framework-demo' ), |
|
43 | - * 'parent' => __( 'Parent APF Post', 'admin-page-framework-demo' ), |
|
44 | - * |
|
45 | - * // (framework specific) |
|
46 | - * 'plugin_action_link' => __( 'APF Posts', 'admin-page-framework-demo' ), // framework specific key. [3.7.3+] |
|
47 | - * ), |
|
48 | - * 'public' => true, |
|
49 | - * 'menu_position' => 110, |
|
50 | - * 'supports' => array( 'title' ), // e.g. array( 'title', 'editor', 'comments', 'thumbnail', 'excerpt' ), |
|
51 | - * 'taxonomies' => array( '' ), |
|
52 | - * 'has_archive' => true, |
|
53 | - * 'show_admin_column' => true, // [3.5+ core] this is for custom taxonomies to automatically add the column in the listing table. |
|
54 | - * 'menu_icon' => $this->oProp->bIsAdmin |
|
55 | - * ? ( |
|
56 | - * version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) |
|
57 | - * ? 'dashicons-wordpress' |
|
58 | - * : plugins_url( 'asset/image/wp-logo_16x16.png', APFDEMO_FILE ) |
|
59 | - * ) |
|
60 | - * : null, // do not call the function in the front-end. |
|
61 | - * |
|
62 | - * // (framework specific) this sets the screen icon for the post type for WordPress v3.7.1 or below. |
|
63 | - * // a file path can be passed instead of a url, plugins_url( 'asset/image/wp-logo_32x32.png', APFDEMO_FILE ) |
|
64 | - * 'screen_icon' => dirname( APFDEMO_FILE ) . '/asset/image/wp-logo_32x32.png', |
|
65 | - * |
|
66 | - * // [3.5.10+] (framework specific) default: true |
|
67 | - * 'show_submenu_add_new' => true, |
|
68 | - * |
|
21 | + * The constructor of the class object. |
|
22 | + * |
|
23 | + * Registers necessary hooks and sets up internal properties. |
|
24 | + * |
|
25 | + * <h4>Example</h4> |
|
26 | + * <code>new APF_PostType( |
|
27 | + * 'apf_posts', // post type slug |
|
28 | + * array( |
|
29 | + * 'labels' => array( |
|
30 | + * 'name' => 'Demo', |
|
31 | + * 'all_items' => __( 'Sample Posts', 'admin-page-framework-demo' ), |
|
32 | + * 'singular_name' => 'Demo', |
|
33 | + * 'add_new' => __( 'Add New', 'admin-page-framework-demo' ), |
|
34 | + * 'add_new_item' => __( 'Add New APF Post', 'admin-page-framework-demo' ), |
|
35 | + * 'edit' => __( 'Edit', 'admin-page-framework-demo' ), |
|
36 | + * 'edit_item' => __( 'Edit APF Post', 'admin-page-framework-demo' ), |
|
37 | + * 'new_item' => __( 'New APF Post', 'admin-page-framework-demo' ), |
|
38 | + * 'view' => __( 'View', 'admin-page-framework-demo' ), |
|
39 | + * 'view_item' => __( 'View APF Post', 'admin-page-framework-demo' ), |
|
40 | + * 'search_items' => __( 'Search APF Post', 'admin-page-framework-demo' ), |
|
41 | + * 'not_found' => __( 'No APF Post found', 'admin-page-framework-demo' ), |
|
42 | + * 'not_found_in_trash' => __( 'No APF Post found in Trash', 'admin-page-framework-demo' ), |
|
43 | + * 'parent' => __( 'Parent APF Post', 'admin-page-framework-demo' ), |
|
44 | + * |
|
45 | + * // (framework specific) |
|
46 | + * 'plugin_action_link' => __( 'APF Posts', 'admin-page-framework-demo' ), // framework specific key. [3.7.3+] |
|
47 | + * ), |
|
48 | + * 'public' => true, |
|
49 | + * 'menu_position' => 110, |
|
50 | + * 'supports' => array( 'title' ), // e.g. array( 'title', 'editor', 'comments', 'thumbnail', 'excerpt' ), |
|
51 | + * 'taxonomies' => array( '' ), |
|
52 | + * 'has_archive' => true, |
|
53 | + * 'show_admin_column' => true, // [3.5+ core] this is for custom taxonomies to automatically add the column in the listing table. |
|
54 | + * 'menu_icon' => $this->oProp->bIsAdmin |
|
55 | + * ? ( |
|
56 | + * version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) |
|
57 | + * ? 'dashicons-wordpress' |
|
58 | + * : plugins_url( 'asset/image/wp-logo_16x16.png', APFDEMO_FILE ) |
|
59 | + * ) |
|
60 | + * : null, // do not call the function in the front-end. |
|
61 | + * |
|
62 | + * // (framework specific) this sets the screen icon for the post type for WordPress v3.7.1 or below. |
|
63 | + * // a file path can be passed instead of a url, plugins_url( 'asset/image/wp-logo_32x32.png', APFDEMO_FILE ) |
|
64 | + * 'screen_icon' => dirname( APFDEMO_FILE ) . '/asset/image/wp-logo_32x32.png', |
|
65 | + * |
|
66 | + * // [3.5.10+] (framework specific) default: true |
|
67 | + * 'show_submenu_add_new' => true, |
|
68 | + * |
|
69 | 69 | // [3.7.4+] (framework specific) default: 10 |
70 | 70 | 'submenu_order_manage' => 20, |
71 | 71 | 'submenu_order_addnew' => 21, |
72 | - * |
|
73 | - * ) |
|
74 | - * );</code> |
|
75 | - * |
|
76 | - * <h4>Framework Specific Post Type Arguments</h4> |
|
77 | - * In addition to the post type argument structure defined by the WordPress core, there are arguments defined by the framework. |
|
78 | - * |
|
79 | - * - screen_icon - For WordPress 3.7.x or below, set an icon url or path for the 32x32 screen icon displayed in the post listing page. |
|
80 | - * - show_submenu_add_new - [3.5.10+] (boolean) Whether the sub-menu item of `Add New` should be displayed. |
|
81 | - * - submenu_order_manage - [3.7.4+] (numeric) The menu position of the `Manage` sub-menu item which gets automatically crated by the system when the admin ui is enabled. Default: `5` |
|
82 | - * - submenu_order_addnew - [3.7.4+] (numeric) The menu position of the `Manage` sub-menu item which gets automatically crated by the system when the admin ui is enabled. Default: `10` |
|
83 | - * |
|
84 | - * <h4>Framework Specific Post Type Label Arguments</h4> |
|
85 | - * - plugin_listing_table_title_cell_link' - [3.0.6+] Deprecated [3.7.3] use the `plugin_action_link` argument instead. |
|
86 | - * - plugin_action_link' - [3.7.3+] If the caller script is a plugin, this determines the label of the action link embedded in the plugin listing page (plugins.php). |
|
87 | - * To disable the action link, set an empty string `''`. |
|
88 | - |
|
89 | - * |
|
90 | - * @since 2.0.0 |
|
91 | - * @since 2.1.6 Added the $sTextDomain parameter. |
|
92 | - * @see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments |
|
93 | - * @param string The post type slug. |
|
94 | - * @param array The <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Arguments">argument array</a> passed to register_post_type(). |
|
95 | - * @param string The path of the caller script. This is used to retrieve the script information to insert it into the footer. If not set, the framework tries to detect it. |
|
96 | - * @param string The text domain of the caller script. |
|
97 | - * @return void |
|
98 | - */ |
|
72 | + * |
|
73 | + * ) |
|
74 | + * );</code> |
|
75 | + * |
|
76 | + * <h4>Framework Specific Post Type Arguments</h4> |
|
77 | + * In addition to the post type argument structure defined by the WordPress core, there are arguments defined by the framework. |
|
78 | + * |
|
79 | + * - screen_icon - For WordPress 3.7.x or below, set an icon url or path for the 32x32 screen icon displayed in the post listing page. |
|
80 | + * - show_submenu_add_new - [3.5.10+] (boolean) Whether the sub-menu item of `Add New` should be displayed. |
|
81 | + * - submenu_order_manage - [3.7.4+] (numeric) The menu position of the `Manage` sub-menu item which gets automatically crated by the system when the admin ui is enabled. Default: `5` |
|
82 | + * - submenu_order_addnew - [3.7.4+] (numeric) The menu position of the `Manage` sub-menu item which gets automatically crated by the system when the admin ui is enabled. Default: `10` |
|
83 | + * |
|
84 | + * <h4>Framework Specific Post Type Label Arguments</h4> |
|
85 | + * - plugin_listing_table_title_cell_link' - [3.0.6+] Deprecated [3.7.3] use the `plugin_action_link` argument instead. |
|
86 | + * - plugin_action_link' - [3.7.3+] If the caller script is a plugin, this determines the label of the action link embedded in the plugin listing page (plugins.php). |
|
87 | + * To disable the action link, set an empty string `''`. |
|
88 | + * |
|
89 | + * @since 2.0.0 |
|
90 | + * @since 2.1.6 Added the $sTextDomain parameter. |
|
91 | + * @see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments |
|
92 | + * @param string The post type slug. |
|
93 | + * @param array The <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Arguments">argument array</a> passed to register_post_type(). |
|
94 | + * @param string The path of the caller script. This is used to retrieve the script information to insert it into the footer. If not set, the framework tries to detect it. |
|
95 | + * @param string The text domain of the caller script. |
|
96 | + * @return void |
|
97 | + */ |
|
99 | 98 | public function __construct( $sPostType, $aArguments=array(), $sCallerPath=null, $sTextDomain='admin-page-framework' ) { |
100 | 99 | |
101 | 100 | if ( empty( $sPostType ) ) { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @package AdminPageFramework |
18 | 18 | * @subpackage PostType |
19 | 19 | */ |
20 | -abstract class AdminPageFramework_PostType_Controller extends AdminPageFramework_PostType_View { |
|
20 | +abstract class AdminPageFramework_PostType_Controller extends AdminPageFramework_PostType_View { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Sets up hooks and properties. |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @since 3.0.0 |
80 | 80 | * @return array An array holding the handle IDs of queued items. |
81 | 81 | */ |
82 | - public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) { |
|
82 | + public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) { |
|
83 | 83 | if ( method_exists( $this->oResource, '_enqueueStyles' ) ) { |
84 | 84 | return $this->oResource->_enqueueStyles( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs ); |
85 | 85 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @since 3.0.0 |
116 | 116 | */ |
117 | - public function enqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
117 | + public function enqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
118 | 118 | if ( method_exists( $this->oResource, '_enqueueScript' ) ) { |
119 | 119 | return $this->oResource->_enqueueScript( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs ); |
120 | 120 | } |
@@ -20,37 +20,37 @@ discard block |
||
20 | 20 | abstract class AdminPageFramework_PostType_Controller extends AdminPageFramework_PostType_View { |
21 | 21 | |
22 | 22 | /** |
23 | - * The method for necessary set-ups. |
|
24 | - * |
|
25 | - * <h4>Example</h4> |
|
26 | - * <code>public function setUp() { |
|
27 | - * $this->setAutoSave( false ); |
|
28 | - * $this->setAuthorTableFilter( true ); |
|
29 | - * $this->addTaxonomy( |
|
30 | - * 'sample_taxonomy', // taxonomy slug |
|
31 | - * array( // argument - for the argument array keys, refer to : http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments |
|
32 | - * 'labels' => array( |
|
33 | - * 'name' => 'Genre', |
|
34 | - * 'add_new_item' => 'Add New Genre', |
|
35 | - * 'new_item_name' => "New Genre" |
|
36 | - * ), |
|
37 | - * 'show_ui' => true, |
|
38 | - * 'show_tagcloud' => false, |
|
39 | - * 'hierarchical' => true, |
|
40 | - * 'show_admin_column' => true, |
|
41 | - * 'show_in_nav_menus' => true, |
|
42 | - * 'show_table_filter' => true, // framework specific key |
|
43 | - * 'show_in_sidebar_menus' => false, // framework specific key |
|
44 | - * ) |
|
45 | - * ); |
|
46 | - * }</code> |
|
47 | - * |
|
48 | - * @abstract |
|
49 | - * @since 2.0.0 |
|
50 | - * @remark The user should override this method in their class definition. |
|
51 | - * @remark A callback for the `wp_loaded` hook. |
|
52 | - * @callback action init |
|
53 | - */ |
|
23 | + * The method for necessary set-ups. |
|
24 | + * |
|
25 | + * <h4>Example</h4> |
|
26 | + * <code>public function setUp() { |
|
27 | + * $this->setAutoSave( false ); |
|
28 | + * $this->setAuthorTableFilter( true ); |
|
29 | + * $this->addTaxonomy( |
|
30 | + * 'sample_taxonomy', // taxonomy slug |
|
31 | + * array( // argument - for the argument array keys, refer to : http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments |
|
32 | + * 'labels' => array( |
|
33 | + * 'name' => 'Genre', |
|
34 | + * 'add_new_item' => 'Add New Genre', |
|
35 | + * 'new_item_name' => "New Genre" |
|
36 | + * ), |
|
37 | + * 'show_ui' => true, |
|
38 | + * 'show_tagcloud' => false, |
|
39 | + * 'hierarchical' => true, |
|
40 | + * 'show_admin_column' => true, |
|
41 | + * 'show_in_nav_menus' => true, |
|
42 | + * 'show_table_filter' => true, // framework specific key |
|
43 | + * 'show_in_sidebar_menus' => false, // framework specific key |
|
44 | + * ) |
|
45 | + * ); |
|
46 | + * }</code> |
|
47 | + * |
|
48 | + * @abstract |
|
49 | + * @since 2.0.0 |
|
50 | + * @remark The user should override this method in their class definition. |
|
51 | + * @remark A callback for the `wp_loaded` hook. |
|
52 | + * @callback action init |
|
53 | + */ |
|
54 | 54 | public function setUp() {} |
55 | 55 | |
56 | 56 | /** |
@@ -116,49 +116,49 @@ discard block |
||
116 | 116 | * Front-end methods |
117 | 117 | */ |
118 | 118 | /** |
119 | - * Enables or disables the auto-save feature in the custom post type's post submission page. |
|
120 | - * |
|
121 | - * <h4>Example</h4> |
|
122 | - * <code>$this->setAutoSave( false ); |
|
123 | - * </code> |
|
124 | - * |
|
125 | - * @since 2.0.0 |
|
126 | - * @param boolean If true, it enables the auto-save; otherwise, it disables it. |
|
127 | - * return void |
|
128 | - */ |
|
119 | + * Enables or disables the auto-save feature in the custom post type's post submission page. |
|
120 | + * |
|
121 | + * <h4>Example</h4> |
|
122 | + * <code>$this->setAutoSave( false ); |
|
123 | + * </code> |
|
124 | + * |
|
125 | + * @since 2.0.0 |
|
126 | + * @param boolean If true, it enables the auto-save; otherwise, it disables it. |
|
127 | + * return void |
|
128 | + */ |
|
129 | 129 | protected function setAutoSave( $bEnableAutoSave=True ) { |
130 | 130 | $this->oProp->bEnableAutoSave = $bEnableAutoSave; |
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
134 | - * Adds a custom taxonomy to the class post type. |
|
135 | - * <h4>Example</h4> |
|
136 | - * <code>$this->addTaxonomy( |
|
137 | - * 'sample_taxonomy', // taxonomy slug |
|
138 | - * array( // argument |
|
139 | - * 'labels' => array( |
|
140 | - * 'name' => 'Genre', |
|
141 | - * 'add_new_item' => 'Add New Genre', |
|
142 | - * 'new_item_name' => "New Genre" |
|
143 | - * ), |
|
144 | - * 'show_ui' => true, |
|
145 | - * 'show_tagcloud' => false, |
|
146 | - * 'hierarchical' => true, |
|
147 | - * 'show_admin_column' => true, |
|
148 | - * 'show_in_nav_menus' => true, |
|
149 | - * 'show_table_filter' => true, // framework specific key |
|
150 | - * 'show_in_sidebar_menus' => false, // framework specific key |
|
151 | - * ) |
|
152 | - * );</code> |
|
153 | - * |
|
154 | - * @see http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments |
|
155 | - * @since 2.0.0 |
|
156 | - * @since 3.1.1 Added the third parameter. |
|
157 | - * @param string $sTaxonomySlug The taxonomy slug. |
|
158 | - * @param array $aArguments The taxonomy argument array passed to the second parameter of the <a href="http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments">register_taxonomy()</a> function. |
|
159 | - * @param array $aAdditionalObjectTypes Additional object types (post types) besides the caller post type. |
|
160 | - * @return void |
|
161 | - */ |
|
134 | + * Adds a custom taxonomy to the class post type. |
|
135 | + * <h4>Example</h4> |
|
136 | + * <code>$this->addTaxonomy( |
|
137 | + * 'sample_taxonomy', // taxonomy slug |
|
138 | + * array( // argument |
|
139 | + * 'labels' => array( |
|
140 | + * 'name' => 'Genre', |
|
141 | + * 'add_new_item' => 'Add New Genre', |
|
142 | + * 'new_item_name' => "New Genre" |
|
143 | + * ), |
|
144 | + * 'show_ui' => true, |
|
145 | + * 'show_tagcloud' => false, |
|
146 | + * 'hierarchical' => true, |
|
147 | + * 'show_admin_column' => true, |
|
148 | + * 'show_in_nav_menus' => true, |
|
149 | + * 'show_table_filter' => true, // framework specific key |
|
150 | + * 'show_in_sidebar_menus' => false, // framework specific key |
|
151 | + * ) |
|
152 | + * );</code> |
|
153 | + * |
|
154 | + * @see http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments |
|
155 | + * @since 2.0.0 |
|
156 | + * @since 3.1.1 Added the third parameter. |
|
157 | + * @param string $sTaxonomySlug The taxonomy slug. |
|
158 | + * @param array $aArguments The taxonomy argument array passed to the second parameter of the <a href="http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments">register_taxonomy()</a> function. |
|
159 | + * @param array $aAdditionalObjectTypes Additional object types (post types) besides the caller post type. |
|
160 | + * @return void |
|
161 | + */ |
|
162 | 162 | protected function addTaxonomy( $sTaxonomySlug, array $aArguments, array $aAdditionalObjectTypes=array() ) { |
163 | 163 | |
164 | 164 | $sTaxonomySlug = $this->oUtil->sanitizeSlug( $sTaxonomySlug ); |
@@ -220,16 +220,16 @@ discard block |
||
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
223 | - * Sets whether the author drop-down filter is enabled/disabled in the post type post list table. |
|
224 | - * |
|
225 | - * <h4>Example</h4> |
|
226 | - * <code>$this->setAuthorTableFilter( true ); |
|
227 | - * </code> |
|
228 | - * |
|
229 | - * @since 2.0.0 |
|
230 | - * @param boolean $bEnableAuthorTableFileter If true, it enables the author filter; otherwise, it disables it. |
|
231 | - * @return void |
|
232 | - */ |
|
223 | + * Sets whether the author drop-down filter is enabled/disabled in the post type post list table. |
|
224 | + * |
|
225 | + * <h4>Example</h4> |
|
226 | + * <code>$this->setAuthorTableFilter( true ); |
|
227 | + * </code> |
|
228 | + * |
|
229 | + * @since 2.0.0 |
|
230 | + * @param boolean $bEnableAuthorTableFileter If true, it enables the author filter; otherwise, it disables it. |
|
231 | + * @return void |
|
232 | + */ |
|
233 | 233 | protected function setAuthorTableFilter( $bEnableAuthorTableFileter=false ) { |
234 | 234 | $this->oProp->bEnableAuthorTableFileter = $bEnableAuthorTableFileter; |
235 | 235 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * @since 3.0.0 |
72 | 72 | * @return array An array holding the handle IDs of queued items. |
73 | 73 | */ |
74 | - public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) { |
|
74 | + public function enqueueStyles( $aSRCs, $aCustomArgs = array() ) { |
|
75 | 75 | if ( method_exists( $this->oResource, '_enqueueStyles' ) ) { |
76 | 76 | return $this->oResource->_enqueueStyles( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs ); |
77 | 77 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * {@inheritdoc} |
83 | 83 | * |
84 | 84 | */ |
85 | - public function enqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
85 | + public function enqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
86 | 86 | if ( method_exists( $this->oResource, '_enqueueStyle' ) ) { |
87 | 87 | return $this->oResource->_enqueueStyle( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs ); |
88 | 88 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @return array An array holding the handle IDs of queued items. |
96 | 96 | */ |
97 | - public function enqueueScripts( $aSRCs, $aCustomArgs=array() ) { |
|
97 | + public function enqueueScripts( $aSRCs, $aCustomArgs = array() ) { |
|
98 | 98 | if ( method_exists( $this->oResource, '_enqueueScripts' ) ) { |
99 | 99 | return $this->oResource->_enqueueScripts( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs ); |
100 | 100 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @since 3.0.0 |
108 | 108 | */ |
109 | - public function enqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
109 | + public function enqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
110 | 110 | if ( method_exists( $this->oResource, '_enqueueScript' ) ) { |
111 | 111 | return $this->oResource->_enqueueScript( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs ); |
112 | 112 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @param boolean If true, it enables the auto-save; otherwise, it disables it. |
127 | 127 | * return void |
128 | 128 | */ |
129 | - protected function setAutoSave( $bEnableAutoSave=True ) { |
|
129 | + protected function setAutoSave( $bEnableAutoSave = True ) { |
|
130 | 130 | $this->oProp->bEnableAutoSave = $bEnableAutoSave; |
131 | 131 | } |
132 | 132 | |
@@ -159,20 +159,20 @@ discard block |
||
159 | 159 | * @param array $aAdditionalObjectTypes Additional object types (post types) besides the caller post type. |
160 | 160 | * @return void |
161 | 161 | */ |
162 | - protected function addTaxonomy( $sTaxonomySlug, array $aArguments, array $aAdditionalObjectTypes=array() ) { |
|
162 | + protected function addTaxonomy( $sTaxonomySlug, array $aArguments, array $aAdditionalObjectTypes = array() ) { |
|
163 | 163 | |
164 | 164 | $sTaxonomySlug = $this->oUtil->sanitizeSlug( $sTaxonomySlug ); |
165 | 165 | $aArguments = $aArguments + array( |
166 | 166 | 'show_table_filter' => null, |
167 | 167 | 'show_in_sidebar_menus' => null, |
168 | - 'submenu_order' => 15, // 3.7.4 |
|
169 | - ) ; |
|
168 | + 'submenu_order' => 15, // 3.7.4 |
|
169 | + ); |
|
170 | 170 | $this->oProp->aTaxonomies[ $sTaxonomySlug ] = $aArguments; |
171 | 171 | |
172 | 172 | if ( $aArguments[ 'show_table_filter' ] ) { |
173 | - $this->oProp->aTaxonomyTableFilters[] = $sTaxonomySlug; |
|
173 | + $this->oProp->aTaxonomyTableFilters[ ] = $sTaxonomySlug; |
|
174 | 174 | } |
175 | - if ( ! $aArguments[ 'show_in_sidebar_menus' ] ) { |
|
175 | + if ( !$aArguments[ 'show_in_sidebar_menus' ] ) { |
|
176 | 176 | // @todo investigate the best handling method of taxonomy sub-menu items of a custom post type added to another custom post type menu with the `show_in_menu` arugment. |
177 | 177 | $this->oProp->aTaxonomyRemoveSubmenuPages[ "edit-tags.php?taxonomy={$sTaxonomySlug}&post_type={$this->oProp->sPostType}" ] = "edit.php?post_type={$this->oProp->sPostType}"; |
178 | 178 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | * @param boolean $bEnableAuthorTableFileter If true, it enables the author filter; otherwise, it disables it. |
231 | 231 | * @return void |
232 | 232 | */ |
233 | - protected function setAuthorTableFilter( $bEnableAuthorTableFileter=false ) { |
|
233 | + protected function setAuthorTableFilter( $bEnableAuthorTableFileter = false ) { |
|
234 | 234 | $this->oProp->bEnableAuthorTableFileter = $bEnableAuthorTableFileter; |
235 | 235 | } |
236 | 236 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * @param array $aArguments The <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Arguments">array of arguments</a> to be passed to the second parameter of the `register_post_type()` function. |
256 | 256 | * @since 3.2.0 |
257 | 257 | */ |
258 | - protected function setArguments( array $aArguments=array() ) { |
|
258 | + protected function setArguments( array $aArguments = array() ) { |
|
259 | 259 | $this->oProp->aPostTypeArgs = $aArguments; |
260 | 260 | } |
261 | 261 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @subpackage PostType |
19 | 19 | * @internal |
20 | 20 | */ |
21 | -abstract class AdminPageFramework_PostType_Model extends AdminPageFramework_PostType_Router { |
|
21 | +abstract class AdminPageFramework_PostType_Model extends AdminPageFramework_PostType_Router { |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Sets up hooks and properties. |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @callback filter manage_{post type slug}_posts_custom_column |
112 | 112 | * @return string |
113 | 113 | */ |
114 | - public function _replyToPrintColumnCell( $sColumnKey, $iPostID ) { |
|
114 | + public function _replyToPrintColumnCell( $sColumnKey, $iPostID ) { |
|
115 | 115 | echo $this->oUtil->addAndApplyFilter( |
116 | 116 | $this, |
117 | 117 | "cell_{$this->oProp->sPostType}_{$sColumnKey}", |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function _replyToDisableAutoSave() { |
129 | 129 | |
130 | - if ( $this->oProp->bEnableAutoSave ) { |
|
130 | + if ( $this->oProp->bEnableAutoSave ) { |
|
131 | 131 | return; |
132 | 132 | } |
133 | - if ( $this->oProp->sPostType != get_post_type() ) { |
|
133 | + if ( $this->oProp->sPostType != get_post_type() ) { |
|
134 | 134 | return; |
135 | 135 | } |
136 | 136 | wp_dequeue_script( 'autosave' ); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | if ( $this->oProp->bIsAdmin ) { |
40 | 40 | |
41 | - add_action( 'load_' . $this->oProp->sPostType, array( $this, '_replyToSetUpHooksForModel' ) ); |
|
41 | + add_action( 'load_'.$this->oProp->sPostType, array( $this, '_replyToSetUpHooksForModel' ) ); |
|
42 | 42 | |
43 | 43 | if ( $this->oProp->sCallerPath ) { |
44 | 44 | new AdminPageFramework_PostType_Model__FlushRewriteRules( $this ); |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | |
66 | 66 | // Properties - sets translatable labels. |
67 | 67 | $this->oProp->aColumnHeaders = array( |
68 | - 'cb' => '<input type="checkbox" />', // Checkbox for bulk actions. |
|
69 | - 'title' => $this->oMsg->get( 'title' ), // Post title. Includes "edit", "quick edit", "trash" and "view" links. If $mode (set from $_REQUEST['mode']) is 'excerpt', a post excerpt is included between the title and links. |
|
70 | - 'author' => $this->oMsg->get( 'author' ), // Post author. |
|
68 | + 'cb' => '<input type="checkbox" />', // Checkbox for bulk actions. |
|
69 | + 'title' => $this->oMsg->get( 'title' ), // Post title. Includes "edit", "quick edit", "trash" and "view" links. If $mode (set from $_REQUEST['mode']) is 'excerpt', a post excerpt is included between the title and links. |
|
70 | + 'author' => $this->oMsg->get( 'author' ), // Post author. |
|
71 | 71 | 'comments' => '<div class="comment-grey-bubble"></div>', // Number of pending comments. |
72 | - 'date' => $this->oMsg->get( 'date' ), // The date and publish status of the post. |
|
72 | + 'date' => $this->oMsg->get( 'date' ), // The date and publish status of the post. |
|
73 | 73 | ); |
74 | 74 | |
75 | 75 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | echo $this->oUtil->addAndApplyFilter( |
132 | 132 | $this, |
133 | 133 | "cell_{$this->oProp->sPostType}_{$sColumnKey}", |
134 | - '', // value to be filtered - cell output |
|
134 | + '', // value to be filtered - cell output |
|
135 | 135 | $iPostID |
136 | 136 | ); |
137 | 137 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @internal |
181 | 181 | */ |
182 | 182 | public function _replyToRegisterTaxonomies() { |
183 | - foreach( $this->oProp->aTaxonomies as $_sTaxonomySlug => $_aArguments ) { |
|
183 | + foreach ( $this->oProp->aTaxonomies as $_sTaxonomySlug => $_aArguments ) { |
|
184 | 184 | $this->_registerTaxonomy( |
185 | 185 | $_sTaxonomySlug, |
186 | 186 | $this->oUtil->getAsArray( $this->oProp->aTaxonomyObjectTypes[ $_sTaxonomySlug ] ), // object types |
@@ -196,8 +196,8 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function _registerTaxonomy( $sTaxonomySlug, array $aObjectTypes, array $aArguments ) { |
198 | 198 | |
199 | - if ( ! in_array( $this->oProp->sPostType, $aObjectTypes ) ) { |
|
200 | - $aObjectTypes[] = $this->oProp->sPostType; |
|
199 | + if ( !in_array( $this->oProp->sPostType, $aObjectTypes ) ) { |
|
200 | + $aObjectTypes[ ] = $this->oProp->sPostType; |
|
201 | 201 | } |
202 | 202 | register_taxonomy( |
203 | 203 | $sTaxonomySlug, |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function _replyToRemoveTexonomySubmenuPages() { |
237 | 237 | |
238 | - foreach( $this->oProp->aTaxonomyRemoveSubmenuPages as $sSubmenuPageSlug => $sTopLevelPageSlug ) { |
|
238 | + foreach ( $this->oProp->aTaxonomyRemoveSubmenuPages as $sSubmenuPageSlug => $sTopLevelPageSlug ) { |
|
239 | 239 | |
240 | 240 | remove_submenu_page( $sTopLevelPageSlug, $sSubmenuPageSlug ); |
241 | 241 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @subpackage PostType |
17 | 17 | * @internal |
18 | 18 | */ |
19 | -abstract class AdminPageFramework_PostType_Router extends AdminPageFramework_Factory { |
|
19 | +abstract class AdminPageFramework_PostType_Router extends AdminPageFramework_Factory { |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Determines whether the currently loaded page is of the post type page. |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * |
88 | 88 | * @since 3.7.10 |
89 | 89 | * @internal |
90 | - * @return null|object |
|
90 | + * @return AdminPageFramework_Link_post_type |
|
91 | 91 | */ |
92 | 92 | protected function _getLinkObject() { |
93 | 93 | return new AdminPageFramework_Link_post_type( $this->oProp, $this->oMsg ); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @since 3.7.10 |
100 | 100 | * @internal |
101 | - * @return null|object |
|
101 | + * @return AdminPageFramework_PageLoadInfo_post_type |
|
102 | 102 | */ |
103 | 103 | protected function _getPageLoadObject() { |
104 | 104 | return new AdminPageFramework_PageLoadInfo_post_type( $this->oProp, $this->oMsg ); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function _replyToDetermineToLoadAdmin( /* $oScreen */ ) { |
46 | 46 | |
47 | - if ( ! $this->_isInThePage() ) { |
|
47 | + if ( !$this->_isInThePage() ) { |
|
48 | 48 | return; |
49 | 49 | } |
50 | 50 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | public function _isInThePage() { |
116 | 116 | |
117 | 117 | // If it's not in one of the post type's pages |
118 | - if ( ! $this->oProp->bIsAdmin ) { |
|
118 | + if ( !$this->oProp->bIsAdmin ) { |
|
119 | 119 | return false; |
120 | 120 | } |
121 | 121 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | return true; |
125 | 125 | } |
126 | 126 | |
127 | - if ( ! in_array( $this->oProp->sPageNow, array( 'edit.php', 'edit-tags.php', 'post.php', 'post-new.php' ) ) ) { |
|
127 | + if ( !in_array( $this->oProp->sPageNow, array( 'edit.php', 'edit-tags.php', 'post.php', 'post-new.php' ) ) ) { |
|
128 | 128 | return false; |
129 | 129 | } |
130 | 130 |