@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | /** |
| 22 | 22 | * Defines the field type slugs used for this field type. |
| 23 | 23 | */ |
| 24 | - public $aFieldTypeSlugs = array( 'media', ); |
|
| 24 | + public $aFieldTypeSlugs = array( 'media',); |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Defines the default key-values of this field type. |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | return |
| 54 | 54 | $this->_getScript_MediaUploader( |
| 55 | 55 | "admin_page_framework" |
| 56 | - ) . PHP_EOL |
|
| 56 | + ).PHP_EOL |
|
| 57 | 57 | . $this->_getScript_RegisterCallbacks(); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $_sInsertFromURL = esc_js( $this->oMsg->get( 'insert_from_url' ) ); |
| 149 | 149 | |
| 150 | 150 | // If the WordPress version is 3.4.x or below |
| 151 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
| 151 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
| 152 | 152 | return <<<JAVASCRIPTS |
| 153 | 153 | /** |
| 154 | 154 | * Bind/rebinds the thickbox script the given selector element. |
@@ -388,10 +388,10 @@ discard block |
||
| 388 | 388 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
| 389 | 389 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
| 390 | 390 | // which causes the PHP syntax error. |
| 391 | - $_sButtonHTML = '"' . $this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ) . '"'; |
|
| 391 | + $_sButtonHTML = '"'.$this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ).'"'; |
|
| 392 | 392 | $_sRpeatable = $this->getAOrB( $bRpeatable, 'true', 'false' ); |
| 393 | 393 | $_sExternalSource = $this->getAOrB( $bExternalSource, 'true', 'false' ); |
| 394 | - $_sScript = <<<JAVASCRIPTS |
|
| 394 | + $_sScript = <<<JAVASCRIPTS |
|
| 395 | 395 | if ( jQuery( 'a#select_media_{$sInputID}' ).length == 0 ) { |
| 396 | 396 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
| 397 | 397 | } |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | . '/* <![CDATA[ */' |
| 405 | 405 | . $_sScript |
| 406 | 406 | . '/* ]]> */' |
| 407 | - . "</script>". PHP_EOL; |
|
| 407 | + . "</script>".PHP_EOL; |
|
| 408 | 408 | |
| 409 | 409 | } |
| 410 | 410 | /** |
@@ -414,19 +414,19 @@ discard block |
||
| 414 | 414 | */ |
| 415 | 415 | private function _getUploaderButtonHTML_Media( $sInputID, array $aButtonAttributes, $bExternalSource ) { |
| 416 | 416 | |
| 417 | - $_bIsLabelSet = isset( $aButtonAttributes['data-label'] ) && $aButtonAttributes['data-label']; |
|
| 417 | + $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ]; |
|
| 418 | 418 | $_aAttributes = $this->_getFormattedUploadButtonAttributes_Media( |
| 419 | 419 | $sInputID, |
| 420 | 420 | $aButtonAttributes, |
| 421 | 421 | $_bIsLabelSet, |
| 422 | 422 | $bExternalSource |
| 423 | 423 | ); |
| 424 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
| 424 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
| 425 | 425 | . $this->getAOrB( |
| 426 | 426 | $_bIsLabelSet, |
| 427 | - $_aAttributes['data-label'], |
|
| 427 | + $_aAttributes[ 'data-label' ], |
|
| 428 | 428 | $this->getAOrB( |
| 429 | - strrpos( $_aAttributes['class'], 'dashicons' ), |
|
| 429 | + strrpos( $_aAttributes[ 'class' ], 'dashicons' ), |
|
| 430 | 430 | '', |
| 431 | 431 | $this->oMsg->get( 'select_file' ) |
| 432 | 432 | ) |
@@ -441,26 +441,26 @@ discard block |
||
| 441 | 441 | */ |
| 442 | 442 | private function _getFormattedUploadButtonAttributes_Media( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bExternalSource ) { |
| 443 | 443 | |
| 444 | - $_aAttributes = array( |
|
| 444 | + $_aAttributes = array( |
|
| 445 | 445 | 'id' => "select_media_{$sInputID}", |
| 446 | 446 | 'href' => '#', |
| 447 | - 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), // ? 1 : 0, |
|
| 448 | - 'data-enable_external_source' => ( string ) ( bool ) $bExternalSource, // ? 1 : 0, |
|
| 447 | + 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), // ? 1 : 0, |
|
| 448 | + 'data-enable_external_source' => ( string ) ( bool ) $bExternalSource, // ? 1 : 0, |
|
| 449 | 449 | ) |
| 450 | 450 | + $aButtonAttributes |
| 451 | 451 | + array( |
| 452 | 452 | 'title' => $_bIsLabelSet |
| 453 | - ? $aButtonAttributes['data-label'] |
|
| 453 | + ? $aButtonAttributes[ 'data-label' ] |
|
| 454 | 454 | : $this->oMsg->get( 'select_file' ), |
| 455 | 455 | 'data-label' => null, |
| 456 | 456 | ); |
| 457 | - $_aAttributes['class'] = $this->getClassAttribute( |
|
| 457 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 458 | 458 | 'select_media button button-small ', |
| 459 | 459 | $this->getAOrB( |
| 460 | - trim( $aButtonAttributes['class'] ), |
|
| 461 | - $aButtonAttributes['class'], |
|
| 460 | + trim( $aButtonAttributes[ 'class' ] ), |
|
| 461 | + $aButtonAttributes[ 'class' ], |
|
| 462 | 462 | $this->getAOrB( |
| 463 | - ! $_bIsLabelSet && version_compare( $GLOBALS['wp_version'], '3.8', '>=' ), |
|
| 463 | + !$_bIsLabelSet && version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ), |
|
| 464 | 464 | 'dashicons dashicons-portfolio', |
| 465 | 465 | '' |
| 466 | 466 | ) |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | /** |
| 23 | 23 | * Defines the field type slugs used for this field type. |
| 24 | 24 | */ |
| 25 | - public $aFieldTypeSlugs = array( 'image', ); |
|
| 25 | + public $aFieldTypeSlugs = array( 'image',); |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Defines the default key-values of this field type. |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | protected $aDefaultKeys = array( |
| 33 | 33 | 'attributes_to_store' => array(), // ( array ) This is for the image and media field type. The attributes to save besides URL. e.g. ( for the image field type ) array( 'title', 'alt', 'width', 'height', 'caption', 'id', 'align', 'link' ). |
| 34 | - 'show_preview' => true, // ( boolean ) Indicates whether the image preview should be displayed or not. |
|
| 35 | - 'allow_external_source' => true, // ( boolean ) Indicates whether the media library box has the From URL tab. |
|
| 34 | + 'show_preview' => true, // ( boolean ) Indicates whether the image preview should be displayed or not. |
|
| 35 | + 'allow_external_source' => true, // ( boolean ) Indicates whether the media library box has the From URL tab. |
|
| 36 | 36 | 'attributes' => array( |
| 37 | 37 | 'input' => array( |
| 38 | 38 | 'size' => 40, |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | return // $this->_getScript_CustomMediaUploaderObject() . PHP_EOL |
| 61 | 61 | $this->_getScript_ImageSelector( |
| 62 | 62 | "admin_page_framework" |
| 63 | - ) . PHP_EOL |
|
| 63 | + ).PHP_EOL |
|
| 64 | 64 | . $this->_getScript_RegisterCallbacks(); |
| 65 | 65 | } |
| 66 | 66 | /** |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $_sInsertFromURL = esc_js( $this->oMsg->get( 'insert_from_url' ) ); |
| 184 | 184 | |
| 185 | 185 | // if the WordPress version is 3.4.x or below |
| 186 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
| 186 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
| 187 | 187 | |
| 188 | 188 | return <<<JAVASCRIPTS |
| 189 | 189 | /** |
@@ -569,11 +569,11 @@ discard block |
||
| 569 | 569 | . "<label for='{$aField[ 'input_id' ]}'>" |
| 570 | 570 | . $aField[ 'before_input' ] |
| 571 | 571 | . $this->getAOrB( |
| 572 | - $aField[ 'label' ] && ! $aField[ 'repeatable' ], |
|
| 573 | - "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength( $aField[ 'label_min_width' ] ) . ";'>" . $aField[ 'label' ] . "</span>", |
|
| 572 | + $aField[ 'label' ] && !$aField[ 'repeatable' ], |
|
| 573 | + "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>".$aField[ 'label' ]."</span>", |
|
| 574 | 574 | '' |
| 575 | 575 | ) |
| 576 | - . "<input " . $this->getAttributes( $this->_getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) ) . " />" |
|
| 576 | + . "<input ".$this->getAttributes( $this->_getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) )." />" |
|
| 577 | 577 | . $aField[ 'after_input' ] |
| 578 | 578 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
| 579 | 579 | . $this->getExtraInputFields( $aField ) |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | */ |
| 613 | 613 | private function _getBaseAttributes( array $aField ) { |
| 614 | 614 | |
| 615 | - $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null ); |
|
| 615 | + $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null ); |
|
| 616 | 616 | unset( |
| 617 | 617 | $_aBaseAttributes[ 'input' ], |
| 618 | 618 | $_aBaseAttributes[ 'button' ], |
@@ -678,8 +678,8 @@ discard block |
||
| 678 | 678 | protected function getExtraInputFields( array $aField ) { |
| 679 | 679 | |
| 680 | 680 | $_aOutputs = array(); |
| 681 | - foreach( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
| 682 | - $_aOutputs[] = "<input " . $this->getAttributes( |
|
| 681 | + foreach ( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
| 682 | + $_aOutputs[ ] = "<input ".$this->getAttributes( |
|
| 683 | 683 | array( |
| 684 | 684 | 'id' => "{$aField[ 'input_id' ]}_{$sAttribute}", |
| 685 | 685 | 'type' => 'hidden', |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | '' |
| 696 | 696 | ), |
| 697 | 697 | ) |
| 698 | - ) . "/>"; |
|
| 698 | + )."/>"; |
|
| 699 | 699 | } |
| 700 | 700 | return implode( PHP_EOL, $_aOutputs ); |
| 701 | 701 | |
@@ -707,17 +707,17 @@ discard block |
||
| 707 | 707 | */ |
| 708 | 708 | protected function _getPreviewContainer( $aField, $sImageURL, $aPreviewAtrributes ) { |
| 709 | 709 | |
| 710 | - if ( ! $aField[ 'show_preview' ] ) { |
|
| 710 | + if ( !$aField[ 'show_preview' ] ) { |
|
| 711 | 711 | return ''; |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | $sImageURL = esc_url( $this->getResolvedSRC( $sImageURL, true ) ); |
| 715 | 715 | return |
| 716 | - "<div " . $this->getAttributes( |
|
| 716 | + "<div ".$this->getAttributes( |
|
| 717 | 717 | array( |
| 718 | 718 | 'id' => "image_preview_container_{$aField[ 'input_id' ]}", |
| 719 | - 'class' => 'image_preview ' . $this->getElement( $aPreviewAtrributes, 'class', '' ), |
|
| 720 | - 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
| 719 | + 'class' => 'image_preview '.$this->getElement( $aPreviewAtrributes, 'class', '' ), |
|
| 720 | + 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
| 721 | 721 | . $this->getElement( $aPreviewAtrributes, 'style', '' ), |
| 722 | 722 | ) + $aPreviewAtrributes |
| 723 | 723 | ) |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
| 743 | 743 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
| 744 | 744 | // which causes the PHP syntax error. |
| 745 | - $_sButtonHTML = '"' . $this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $bRpeatable, $bExternalSource ) . '"'; |
|
| 745 | + $_sButtonHTML = '"'.$this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $bRpeatable, $bExternalSource ).'"'; |
|
| 746 | 746 | $_sRepeatable = $this->getAOrB( $bRpeatable, 'true', 'false' ); |
| 747 | 747 | $_bExternalSource = $this->getAOrB( $bExternalSource, 'true', 'false' ); |
| 748 | 748 | $_sScript = <<<JAVASCRIPTS |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | . '/* <![CDATA[ */' |
| 759 | 759 | . $_sScript |
| 760 | 760 | . '/* ]]> */' |
| 761 | - . "</script>". PHP_EOL; |
|
| 761 | + . "</script>".PHP_EOL; |
|
| 762 | 762 | |
| 763 | 763 | } |
| 764 | 764 | /** |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | $bRpeatable, |
| 777 | 777 | $bExternalSource |
| 778 | 778 | ); |
| 779 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
| 779 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
| 780 | 780 | . ( $_bIsLabelSet |
| 781 | 781 | ? $_aAttributes[ 'data-label' ] |
| 782 | 782 | : ( strrpos( $_aAttributes[ 'class' ], 'dashicons' ) |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | */ |
| 795 | 795 | private function _getFormattedUploadButtonAttributes( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bRpeatable, $bExternalSource ) { |
| 796 | 796 | |
| 797 | - $_aAttributes = array( |
|
| 797 | + $_aAttributes = array( |
|
| 798 | 798 | 'id' => "select_image_{$sInputID}", |
| 799 | 799 | 'href' => '#', |
| 800 | 800 | 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | : $this->oMsg->get( 'select_image' ), |
| 808 | 808 | 'data-label' => null, |
| 809 | 809 | ); |
| 810 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 810 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 811 | 811 | 'select_image button button-small ', |
| 812 | 812 | $this->getAOrB( |
| 813 | 813 | trim( $aButtonAttributes[ 'class' ] ), |
@@ -834,16 +834,16 @@ discard block |
||
| 834 | 834 | * @since 3.5.3 Aded the `$sType` parameter. |
| 835 | 835 | * @return string |
| 836 | 836 | */ |
| 837 | - protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
| 837 | + protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
| 838 | 838 | |
| 839 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
| 839 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
| 840 | 840 | return ''; |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
| 844 | 844 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
| 845 | 845 | // which causes the PHP syntax error. |
| 846 | - $_sButtonHTML = '"' . $this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ) . '"'; |
|
| 846 | + $_sButtonHTML = '"'.$this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ).'"'; |
|
| 847 | 847 | $_sScript = <<<JAVASCRIPTS |
| 848 | 848 | if ( 0 === jQuery( 'a#remove_{$sType}_{$sInputID}' ).length ) { |
| 849 | 849 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | . '/* <![CDATA[ */' |
| 855 | 855 | . $_sScript |
| 856 | 856 | . '/* ]]> */' |
| 857 | - . "</script>". PHP_EOL; |
|
| 857 | + . "</script>".PHP_EOL; |
|
| 858 | 858 | |
| 859 | 859 | } |
| 860 | 860 | |
@@ -863,11 +863,11 @@ discard block |
||
| 863 | 863 | * @since 3.5.3 |
| 864 | 864 | * @return string The generated HTML remove button output. |
| 865 | 865 | */ |
| 866 | - protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
| 866 | + protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
| 867 | 867 | |
| 868 | 868 | $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ]; |
| 869 | 869 | $_aAttributes = $this->_getFormattedRemoveButtonAttributesByType( $sInputID, $aButtonAttributes, $_bIsLabelSet, $sType ); |
| 870 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
| 870 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
| 871 | 871 | . ( $_bIsLabelSet |
| 872 | 872 | ? $_aAttributes[ 'data-label' ] |
| 873 | 873 | : $this->getAOrB( |
@@ -885,9 +885,9 @@ discard block |
||
| 885 | 885 | * @since 3.5.3 |
| 886 | 886 | * @return array The formatted remove button attributes array. |
| 887 | 887 | */ |
| 888 | - protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType='image' ) { |
|
| 888 | + protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType = 'image' ) { |
|
| 889 | 889 | |
| 890 | - $_sOnClickFunctionName = 'removeInputValuesFor' . ucfirst( $sType ); |
|
| 890 | + $_sOnClickFunctionName = 'removeInputValuesFor'.ucfirst( $sType ); |
|
| 891 | 891 | $_aAttributes = array( |
| 892 | 892 | 'id' => "remove_{$sType}_{$sInputID}", |
| 893 | 893 | 'href' => '#', |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | ? $aButtonAttributes[ 'data-label' ] |
| 900 | 900 | : $this->oMsg->get( 'remove_value' ), |
| 901 | 901 | ); |
| 902 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 902 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 903 | 903 | "remove_value remove_{$sType} button button-small", |
| 904 | 904 | $this->getAOrB( |
| 905 | 905 | trim( $aButtonAttributes[ 'class' ] ), |
@@ -16,15 +16,15 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
| 18 | 18 | |
| 19 | - const VERSION = '3.7.13b01'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 20 | - const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
|
| 19 | + const VERSION = '3.7.13b01'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 20 | + const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
|
| 21 | 21 | const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
| 22 | - const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
|
| 23 | - const URI = 'http://admin-page-framework.michaeluno.jp/'; |
|
| 24 | - const AUTHOR = 'miunosoft (Michael Uno)'; |
|
| 25 | - const AUTHOR_URI = 'http://en.michaeluno.jp/'; |
|
| 26 | - const COPYRIGHT = 'Copyright (c) 2015-2016, Michael Uno'; |
|
| 27 | - const LICENSE = 'GPL v2 or later'; |
|
| 22 | + const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
|
| 23 | + const URI = 'http://admin-page-framework.michaeluno.jp/'; |
|
| 24 | + const AUTHOR = 'miunosoft (Michael Uno)'; |
|
| 25 | + const AUTHOR_URI = 'http://en.michaeluno.jp/'; |
|
| 26 | + const COPYRIGHT = 'Copyright (c) 2015-2016, Michael Uno'; |
|
| 27 | + const LICENSE = 'GPL v2 or later'; |
|
| 28 | 28 | const CONTRIBUTORS = ''; |
| 29 | 29 | |
| 30 | 30 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @remark This is also accessed from `uninstall.php` so do not remove. |
| 56 | 56 | * @remark Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added. |
| 57 | 57 | */ |
| 58 | - const TRANSIENT_PREFIX = 'APFL_'; |
|
| 58 | + const TRANSIENT_PREFIX = 'APFL_'; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * The hook slug used for the prefix of action and filter hook names. |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * These will be accessed from the bootstrap script. |
| 72 | 72 | */ |
| 73 | - const TEXT_DOMAIN = 'admin-page-framework-loader'; |
|
| 74 | - const TEXT_DOMAIN_PATH = '/language'; |
|
| 73 | + const TEXT_DOMAIN = 'admin-page-framework-loader'; |
|
| 74 | + const TEXT_DOMAIN_PATH = '/language'; |
|
| 75 | 75 | |
| 76 | - // These properties will be defined in the setUp() method. |
|
| 77 | - static public $sFilePath = ''; |
|
| 78 | - static public $sDirPath = ''; |
|
| 76 | + // These properties will be defined in the setUp() method. |
|
| 77 | + static public $sFilePath = ''; |
|
| 78 | + static public $sDirPath = ''; |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Requirements. |
@@ -136,34 +136,34 @@ discard block |
||
| 136 | 136 | static public $aTaxonomies = array( |
| 137 | 137 | ); |
| 138 | 138 | |
| 139 | - /** |
|
| 140 | - * Sets up static properties. |
|
| 139 | + /** |
|
| 140 | + * Sets up static properties. |
|
| 141 | 141 | * @return void |
| 142 | - */ |
|
| 143 | - static public function setUp( $sPluginFilePath ) { |
|
| 142 | + */ |
|
| 143 | + static public function setUp( $sPluginFilePath ) { |
|
| 144 | 144 | |
| 145 | - self::$sFilePath = $sPluginFilePath; |
|
| 146 | - self::$sDirPath = dirname( self::$sFilePath ); |
|
| 145 | + self::$sFilePath = $sPluginFilePath; |
|
| 146 | + self::$sDirPath = dirname( self::$sFilePath ); |
|
| 147 | 147 | |
| 148 | - } |
|
| 148 | + } |
|
| 149 | 149 | |
| 150 | - /** |
|
| 151 | - * Returns the URL with the given relative path to the plugin path. |
|
| 152 | - * |
|
| 153 | - * <h3>Example</h3> |
|
| 150 | + /** |
|
| 151 | + * Returns the URL with the given relative path to the plugin path. |
|
| 152 | + * |
|
| 153 | + * <h3>Example</h3> |
|
| 154 | 154 | * <code> |
| 155 | 155 | * AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/css/meta_box.css' ); |
| 156 | 156 | * </code> |
| 157 | 157 | * @since 3.5.0 |
| 158 | 158 | * @return string |
| 159 | - */ |
|
| 160 | - public static function getPluginURL( $sRelativePath='' ) { |
|
| 159 | + */ |
|
| 160 | + public static function getPluginURL( $sRelativePath='' ) { |
|
| 161 | 161 | if ( isset( self::$_sPluginURLCache ) ) { |
| 162 | 162 | return self::$_sPluginURLCache . $sRelativePath; |
| 163 | 163 | } |
| 164 | 164 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
| 165 | 165 | return self::$_sPluginURLCache . $sRelativePath; |
| 166 | - } |
|
| 166 | + } |
|
| 167 | 167 | /** |
| 168 | 168 | * @since 3.7.9 |
| 169 | 169 | */ |
@@ -16,16 +16,16 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
| 18 | 18 | |
| 19 | - const VERSION = '3.7.13b01'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 19 | + const VERSION = '3.7.13b01'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 20 | 20 | const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
| 21 | - const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
| 21 | + const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
| 22 | 22 | const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
| 23 | 23 | const URI = 'http://admin-page-framework.michaeluno.jp/'; |
| 24 | 24 | const AUTHOR = 'miunosoft (Michael Uno)'; |
| 25 | 25 | const AUTHOR_URI = 'http://en.michaeluno.jp/'; |
| 26 | 26 | const COPYRIGHT = 'Copyright (c) 2015-2016, Michael Uno'; |
| 27 | 27 | const LICENSE = 'GPL v2 or later'; |
| 28 | - const CONTRIBUTORS = ''; |
|
| 28 | + const CONTRIBUTORS = ''; |
|
| 29 | 29 | |
| 30 | 30 | } |
| 31 | 31 | /** |
@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | * @remark This is also accessed from `uninstall.php` so do not remove. |
| 56 | 56 | * @remark Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added. |
| 57 | 57 | */ |
| 58 | - const TRANSIENT_PREFIX = 'APFL_'; |
|
| 58 | + const TRANSIENT_PREFIX = 'APFL_'; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * The hook slug used for the prefix of action and filter hook names. |
| 62 | 62 | * |
| 63 | 63 | * @remark The ending underscore is not necessary. |
| 64 | 64 | */ |
| 65 | - const HOOK_SLUG = 'admin_page_framework_loader'; |
|
| 65 | + const HOOK_SLUG = 'admin_page_framework_loader'; |
|
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | static public $aAdminPages = array( |
| 119 | 119 | // key => 'page slug' |
| 120 | - 'about' => 'apfl_about', // the welcome page |
|
| 120 | + 'about' => 'apfl_about', // the welcome page |
|
| 121 | 121 | 'addon' => 'apfl_addons', |
| 122 | 122 | 'tool' => 'apfl_tools', |
| 123 | 123 | 'help' => 'apfl_contact', |
@@ -157,12 +157,12 @@ discard block |
||
| 157 | 157 | * @since 3.5.0 |
| 158 | 158 | * @return string |
| 159 | 159 | */ |
| 160 | - public static function getPluginURL( $sRelativePath='' ) { |
|
| 160 | + public static function getPluginURL( $sRelativePath = '' ) { |
|
| 161 | 161 | if ( isset( self::$_sPluginURLCache ) ) { |
| 162 | - return self::$_sPluginURLCache . $sRelativePath; |
|
| 162 | + return self::$_sPluginURLCache.$sRelativePath; |
|
| 163 | 163 | } |
| 164 | 164 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
| 165 | - return self::$_sPluginURLCache . $sRelativePath; |
|
| 165 | + return self::$_sPluginURLCache.$sRelativePath; |
|
| 166 | 166 | } |
| 167 | 167 | /** |
| 168 | 168 | * @since 3.7.9 |
@@ -192,13 +192,13 @@ discard block |
||
| 192 | 192 | * @since 3.5.0 |
| 193 | 193 | * @return void |
| 194 | 194 | */ |
| 195 | - static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
|
| 196 | - if ( ! is_admin() ) { |
|
| 195 | + static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) { |
|
| 196 | + if ( !is_admin() ) { |
|
| 197 | 197 | return; |
| 198 | 198 | } |
| 199 | - self::$_aAdminNotices[] = array( |
|
| 199 | + self::$_aAdminNotices[ ] = array( |
|
| 200 | 200 | 'message' => $sMessage, |
| 201 | - 'class_attribute' => trim( $sClassAttribute ) . ' notice is-dismissible', |
|
| 201 | + 'class_attribute' => trim( $sClassAttribute ).' notice is-dismissible', |
|
| 202 | 202 | ); |
| 203 | 203 | add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) ); |
| 204 | 204 | } |
@@ -208,12 +208,12 @@ discard block |
||
| 208 | 208 | * @return void |
| 209 | 209 | */ |
| 210 | 210 | static public function _replyToSetAdminNotice() { |
| 211 | - foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
| 212 | - echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>" |
|
| 211 | + foreach ( self::$_aAdminNotices as $_aAdminNotice ) { |
|
| 212 | + echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>" |
|
| 213 | 213 | ."<p>" |
| 214 | 214 | . sprintf( |
| 215 | - '<strong>%1$s</strong>: ' . $_aAdminNotice['message'], |
|
| 216 | - self::NAME . ' ' . self::VERSION |
|
| 215 | + '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ], |
|
| 216 | + self::NAME.' '.self::VERSION |
|
| 217 | 217 | ) |
| 218 | 218 | . "</p>" |
| 219 | 219 | . "</div>"; |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | AdminPageFrameworkLoader_Registry::setUp( __FILE__ ); |
| 226 | 226 | |
| 227 | 227 | // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file. |
| 228 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 228 | +if ( !defined( 'ABSPATH' ) ) { |
|
| 229 | 229 | return; |
| 230 | 230 | } |
| 231 | 231 | if ( defined( 'DOING_UNINSTALL' ) ) { |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false ); |
| 239 | 239 | if ( |
| 240 | - ! $_bFrameworkLoaded |
|
| 241 | - || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
| 240 | + !$_bFrameworkLoaded |
|
| 241 | + || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
| 242 | 242 | || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' ) |
| 243 | 243 | ) { |
| 244 | 244 | AdminPageFrameworkLoader_Registry::setAdminNotice( |
@@ -256,18 +256,18 @@ discard block |
||
| 256 | 256 | add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' ); |
| 257 | 257 | |
| 258 | 258 | // Include the library file - the development version will be available if you cloned the GitHub repository. |
| 259 | -$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php'; |
|
| 259 | +$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php'; |
|
| 260 | 260 | $_bDebugMode = defined( 'WP_DEBUG' ) && WP_DEBUG; |
| 261 | 261 | $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath ); |
| 262 | 262 | include( |
| 263 | 263 | $_bLoadDevelopmentVersion |
| 264 | 264 | ? $_sDevelopmentVersionPath |
| 265 | - : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php' |
|
| 265 | + : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php' |
|
| 266 | 266 | ); |
| 267 | 267 | |
| 268 | 268 | // Include the framework loader plugin components. |
| 269 | 269 | include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] ); |
| 270 | -include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
| 270 | +include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
| 271 | 271 | new AdminPageFrameworkLoader_Bootstrap( |
| 272 | 272 | AdminPageFrameworkLoader_Registry::$sFilePath, |
| 273 | 273 | AdminPageFrameworkLoader_Registry::HOOK_SLUG // hook prefix |