@@ -18,19 +18,19 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function start() { |
20 | 20 | |
21 | - if ( ! $this->oProp->bIsAdmin ) { |
|
21 | + if ( !$this->oProp->bIsAdmin ) { |
|
22 | 22 | return; |
23 | 23 | } |
24 | - if ( ! is_network_admin() ) { |
|
24 | + if ( !is_network_admin() ) { |
|
25 | 25 | return; |
26 | 26 | } |
27 | 27 | |
28 | 28 | // Enable / disable the demo pages |
29 | - if ( isset( $_GET['enable_apfl_demo_pages'] ) ) { |
|
29 | + if ( isset( $_GET[ 'enable_apfl_demo_pages' ] ) ) { |
|
30 | 30 | |
31 | 31 | // Update the options and reload the page |
32 | - $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys['main'] ); |
|
33 | - $_oOption->update( 'enable_demo', $_GET['enable_apfl_demo_pages'] ); |
|
32 | + $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] ); |
|
33 | + $_oOption->update( 'enable_demo', $_GET[ 'enable_apfl_demo_pages' ] ); |
|
34 | 34 | exit( wp_safe_redirect( remove_query_arg( 'enable_apfl_demo_pages' ) ) ); |
35 | 35 | |
36 | 36 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->_getDemoSwitcherLink( $this->oProp->aOptions ) |
50 | 50 | ); |
51 | 51 | $this->addLinkToPluginDescription( |
52 | - "<a href='https://wordpress.org/support/plugin/admin-page-framework' target='_blank'>" . __( 'Support', 'admin-page-framework-loader' ) . "</a>" |
|
52 | + "<a href='https://wordpress.org/support/plugin/admin-page-framework' target='_blank'>".__( 'Support', 'admin-page-framework-loader' )."</a>" |
|
53 | 53 | ); |
54 | 54 | |
55 | 55 | } |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * Returns the switch link of the demo pages. |
59 | 59 | */ |
60 | - private function _getDemoSwitcherLink( $mOptions=array() ) { |
|
60 | + private function _getDemoSwitcherLink( $mOptions = array() ) { |
|
61 | 61 | |
62 | - $_bEnabled = isset( $mOptions['enable_demo'] ) && $mOptions['enable_demo']; |
|
63 | - $_sLink = esc_url( |
|
62 | + $_bEnabled = isset( $mOptions[ 'enable_demo' ] ) && $mOptions[ 'enable_demo' ]; |
|
63 | + $_sLink = esc_url( |
|
64 | 64 | add_query_arg( |
65 | 65 | array( |
66 | 66 | 'enable_apfl_demo_pages' => $_bEnabled ? 0 : 1, |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | ) |
69 | 69 | ); |
70 | 70 | return $_bEnabled |
71 | - ? "<a href='{$_sLink}'>" . __( 'Disable Demo', 'admin-page-framework-loader' ) . "</a>" |
|
72 | - : "<a href='{$_sLink}'><strong style='font-size: 1em;'>" . __( 'Enable Demo', 'admin-page-framework-loader' ) . "</strong></a>"; |
|
71 | + ? "<a href='{$_sLink}'>".__( 'Disable Demo', 'admin-page-framework-loader' )."</a>" |
|
72 | + : "<a href='{$_sLink}'><strong style='font-size: 1em;'>".__( 'Enable Demo', 'admin-page-framework-loader' )."</strong></a>"; |
|
73 | 73 | |
74 | 74 | } |
75 | 75 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function __construct() { |
25 | 25 | |
26 | 26 | new AdminPageFrameworkLoader_Event_Action_GetDevelopmentVersion( |
27 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_action_get_development_version' // action name |
|
27 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_action_get_development_version' // action name |
|
28 | 28 | ); |
29 | 29 | |
30 | 30 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function replyToDoAction() { |
41 | 41 | AdminPageFramework_WPUtility::setTransient( |
42 | - AdminPageFrameworkLoader_Registry::TRANSIENT_PREFIX . 'devver', |
|
42 | + AdminPageFrameworkLoader_Registry::TRANSIENT_PREFIX.'devver', |
|
43 | 43 | $this->_getVersion(), // data - if an error occurs, an empty string will be given |
44 | 44 | 604800 // for one week |
45 | 45 | ); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $_sPageBody = $this->_getPageBody(); |
56 | 56 | $_aHeaders = $_oUtil->getScriptData( |
57 | 57 | $_sPageBody, |
58 | - '', /// context |
|
58 | + '', /// context |
|
59 | 59 | array( 'version' => 'Version' ) |
60 | 60 | ); |
61 | 61 | return $_oUtil->getElement( |
@@ -26,7 +26,7 @@ |
||
26 | 26 | * |
27 | 27 | * @since 3.6.2 |
28 | 28 | */ |
29 | - public function __construct( $sActionName ) { |
|
29 | + public function __construct( $sActionName ) { |
|
30 | 30 | add_action( |
31 | 31 | $sActionName, |
32 | 32 | array( $this, 'replyToDoAction' ) |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @return array |
49 | 49 | */ |
50 | - public function get( $iItems=0 ) { |
|
50 | + public function get( $iItems = 0 ) { |
|
51 | 51 | |
52 | 52 | $_aOutput = array(); |
53 | 53 | $_aURLs = $this->_aURLs; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return $_aOutput; |
57 | 57 | } |
58 | 58 | |
59 | - $_oFeed = fetch_feed( $_aURLs ); |
|
59 | + $_oFeed = fetch_feed( $_aURLs ); |
|
60 | 60 | foreach ( $_oFeed->get_items() as $_oItem ) { |
61 | 61 | $_aOutput[ $_oItem->get_title() ] = array( |
62 | 62 | 'content' => $_oItem->get_content(), |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | 'title' => $_oItem->get_title(), |
65 | 65 | 'date' => $_oItem->get_date( 'j F Y, g:i a' ), |
66 | 66 | 'author' => $_oItem->get_author(), |
67 | - 'link' => $_oItem->get_permalink(), // get_link() may be used as well |
|
67 | + 'link' => $_oItem->get_permalink(), // get_link() may be used as well |
|
68 | 68 | ); |
69 | 69 | } |
70 | 70 |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package Admin Page Framework Loader |
|
4 | - * @copyright Copyright (c) 2015, Michael Uno |
|
5 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
6 | - * @since 3.5.0 |
|
3 | + * @package Admin Page Framework Loader |
|
4 | + * @copyright Copyright (c) 2015, Michael Uno |
|
5 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
6 | + * @since 3.5.0 |
|
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | $_sMaingPluginFileName = 'admin-page-framework-loader.php'; |
32 | 32 | if ( file_exists( dirname( __FILE__ ). '/' . $_sMaingPluginFileName ) ) { |
33 | - include( $_sMaingPluginFileName ); |
|
33 | + include( $_sMaingPluginFileName ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | if ( class_exists( 'AdminPageFrameworkLoader_Registry' ) ) : |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | * @since 3.5.0 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( !defined( 'ABSPATH' ) ) { |
|
13 | 13 | return; |
14 | 14 | } |
15 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
15 | +if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
16 | 16 | return; |
17 | 17 | } |
18 | 18 | |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | * We are going to load the main file to get the registry class. And in the main file, |
22 | 22 | * if this constant is set, it will return after declaring the registry class. |
23 | 23 | **/ |
24 | -if ( ! defined( 'DOING_UNINSTALL' ) ) { |
|
25 | - define( 'DOING_UNINSTALL', true ); |
|
24 | +if ( !defined( 'DOING_UNINSTALL' ) ) { |
|
25 | + define( 'DOING_UNINSTALL', true ); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Set the main plugin file name here. |
30 | 30 | */ |
31 | -$_sMaingPluginFileName = 'admin-page-framework-loader.php'; |
|
32 | -if ( file_exists( dirname( __FILE__ ). '/' . $_sMaingPluginFileName ) ) { |
|
31 | +$_sMaingPluginFileName = 'admin-page-framework-loader.php'; |
|
32 | +if ( file_exists( dirname( __FILE__ ).'/'.$_sMaingPluginFileName ) ) { |
|
33 | 33 | include( $_sMaingPluginFileName ); |
34 | 34 | } |
35 | 35 | |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | // Delete transients |
42 | 42 | $_aPrefixes = array( |
43 | 43 | AdminPageFrameworkLoader_Registry::TRANSIENT_PREFIX, // the plugin transients |
44 | - 'apf_', // the admin page framework transients |
|
44 | + 'apf_', // the admin page framework transients |
|
45 | 45 | ); |
46 | 46 | $_oWPDB = ${ 'GLOBALS' }[ 'wpdb' ]; |
47 | - foreach( $_aPrefixes as $_sPrefix ) { |
|
48 | - if ( ! $_sPrefix ) { |
|
47 | + foreach ( $_aPrefixes as $_sPrefix ) { |
|
48 | + if ( !$_sPrefix ) { |
|
49 | 49 | continue; |
50 | 50 | } |
51 | 51 | $_oWPDB->query( "DELETE FROM `{$_oWPDB->prefix}options` WHERE `option_name` LIKE ( '_transient_%{$_sPrefix}%' )" ); |
@@ -45,7 +45,7 @@ |
||
45 | 45 | ); |
46 | 46 | $_oWPDB = ${ 'GLOBALS' }[ 'wpdb' ]; |
47 | 47 | foreach( $_aPrefixes as $_sPrefix ) { |
48 | - if ( ! $_sPrefix ) { |
|
48 | + if ( ! $_sPrefix ) { |
|
49 | 49 | continue; |
50 | 50 | } |
51 | 51 | $_oWPDB->query( "DELETE FROM `{$_oWPDB->prefix}options` WHERE `option_name` LIKE ( '_transient_%{$_sPrefix}%' )" ); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @since 3.5.0 |
68 | 68 | */ |
69 | - public function enqueueStyles( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
69 | + public function enqueueStyles( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
70 | 70 | return $this->oResource->_enqueueStyles( $aSRCs, $aPostTypes, $aCustomArgs ); |
71 | 71 | } |
72 | 72 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @param array (optional) The argument array for more advanced parameters. |
90 | 90 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
91 | 91 | */ |
92 | - public function enqueueStyle( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
92 | + public function enqueueStyle( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
93 | 93 | return $this->oResource->_enqueueStyle( $sSRC, $aPostTypes, $aCustomArgs ); |
94 | 94 | } |
95 | 95 | /** |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @since 3.5.0 |
99 | 99 | */ |
100 | - public function enqueueScripts( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
100 | + public function enqueueScripts( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
101 | 101 | return $this->oResource->_enqueueScripts( $aSRCs, $aPostTypes, $aCustomArgs ); |
102 | 102 | } |
103 | 103 | /** |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @param array (optional) The argument array for more advanced parameters. |
133 | 133 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
134 | 134 | */ |
135 | - public function enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
135 | + public function enqueueScript( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
136 | 136 | return $this->oResource->_enqueueScript( $sSRC, $aPostTypes, $aCustomArgs ); |
137 | 137 | } |
138 | 138 |
@@ -132,7 +132,7 @@ |
||
132 | 132 | * @param array (optional) The argument array for more advanced parameters. |
133 | 133 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
134 | 134 | */ |
135 | - public function enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
135 | + public function enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
136 | 136 | return $this->oResource->_enqueueScript( $sSRC, $aPostTypes, $aCustomArgs ); |
137 | 137 | } |
138 | 138 |
@@ -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 UI related methods. |
@@ -18,32 +18,32 @@ discard block |
||
18 | 18 | abstract class AdminPageFramework_MetaBox_Controller extends AdminPageFramework_MetaBox_View { |
19 | 19 | |
20 | 20 | /** |
21 | - * The method for all necessary set-ups. |
|
22 | - * |
|
23 | - * <h4>Example</h4> |
|
24 | - * <code> public function setUp() { |
|
25 | - * $this->addSettingFields( |
|
26 | - * array( |
|
27 | - * 'field_id' => 'sample_metabox_text_field', |
|
28 | - * 'title' => 'Text Input', |
|
29 | - * 'description' => 'The description for the field.', |
|
30 | - * 'type' => 'text', |
|
31 | - * ), |
|
32 | - * array( |
|
33 | - * 'field_id' => 'sample_metabox_textarea_field', |
|
34 | - * 'title' => 'Textarea', |
|
35 | - * 'description' => 'The description for the field.', |
|
36 | - * 'type' => 'textarea', |
|
37 | - * 'default' => 'This is a default text value.', |
|
38 | - * ) |
|
39 | - * ); |
|
40 | - * }</code> |
|
41 | - * |
|
42 | - * @abstract |
|
43 | - * @since 2.0.0 |
|
44 | - * @remark The user should override this method. |
|
45 | - * @return void |
|
46 | - */ |
|
21 | + * The method for all necessary set-ups. |
|
22 | + * |
|
23 | + * <h4>Example</h4> |
|
24 | + * <code> public function setUp() { |
|
25 | + * $this->addSettingFields( |
|
26 | + * array( |
|
27 | + * 'field_id' => 'sample_metabox_text_field', |
|
28 | + * 'title' => 'Text Input', |
|
29 | + * 'description' => 'The description for the field.', |
|
30 | + * 'type' => 'text', |
|
31 | + * ), |
|
32 | + * array( |
|
33 | + * 'field_id' => 'sample_metabox_textarea_field', |
|
34 | + * 'title' => 'Textarea', |
|
35 | + * 'description' => 'The description for the field.', |
|
36 | + * 'type' => 'textarea', |
|
37 | + * 'default' => 'This is a default text value.', |
|
38 | + * ) |
|
39 | + * ); |
|
40 | + * }</code> |
|
41 | + * |
|
42 | + * @abstract |
|
43 | + * @since 2.0.0 |
|
44 | + * @remark The user should override this method. |
|
45 | + * @return void |
|
46 | + */ |
|
47 | 47 | public function setUp() {} |
48 | 48 | |
49 | 49 | /** |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * @since DEVVER |
28 | 28 | * @return void |
29 | 29 | */ |
30 | - public function construct() { |
|
30 | + public function construct() { |
|
31 | 31 | $this->_addDefaultResources(); |
32 | 32 | } |
33 | 33 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | ), |
35 | 35 | 2 => __( 'Header already sent.', 'admin-page-framework-loader' ), |
36 | 36 | ); |
37 | - if ( ! class_exists( 'AdminPageFramework_AdminNotice' ) ) { |
|
37 | + if ( !class_exists( 'AdminPageFramework_AdminNotice' ) ) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | new AdminPageFramework_AdminNotice( |
@@ -34,7 +34,7 @@ |
||
34 | 34 | ), |
35 | 35 | 2 => __( 'Header already sent.', 'admin-page-framework-loader' ), |
36 | 36 | ); |
37 | - if ( ! class_exists( 'AdminPageFramework_AdminNotice' ) ) { |
|
37 | + if ( ! class_exists( 'AdminPageFramework_AdminNotice' ) ) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | new AdminPageFramework_AdminNotice( |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | $_aItems = $this->getContentsByHeader( $this->getReadmeContents(), 3 ); |
25 | 25 | $_iLastIndex = count( $_aItems ) - 1; |
26 | - foreach( $_aItems as $_iIndex => $_aContent ) { |
|
26 | + foreach ( $_aItems as $_iIndex => $_aContent ) { |
|
27 | 27 | |
28 | 28 | $_oParser = new AdminPageFramework_WPReadmeParser; |
29 | 29 | $_oParser->setText( $_aContent[ 1 ] ); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $oAdminPage->addSettingSections( |
32 | 32 | $this->sPageSlug, // the target page slug |
33 | 33 | array( |
34 | - 'section_id' => 'examples_' . $_iIndex, |
|
34 | + 'section_id' => 'examples_'.$_iIndex, |
|
35 | 35 | 'title' => $_aContent[ 0 ], |
36 | 36 | 'collapsible' => array( |
37 | 37 | 'toggle_all_button' => $_iLastIndex === $_iIndex |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * @return string |
54 | 54 | */ |
55 | - private function getReadMeContents() { |
|
55 | + private function getReadMeContents() { |
|
56 | 56 | return $this->_getReadmeContents( |
57 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/examples.txt', |
|
57 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/examples.txt', |
|
58 | 58 | '', |
59 | 59 | array( 'Examples' ) |
60 | 60 | ); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | /** |
54 | 54 | * @return string |
55 | 55 | */ |
56 | - private function getReadMeContents() { |
|
56 | + private function getReadMeContents() { |
|
57 | 57 | return $this->_getReadmeContents( |
58 | 58 | AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', // source path |
59 | 59 | '', // TOC title |