@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | $actions = ['get_post_types', 'get_terms', 'get_image_size_names_and_dimensions', |
| 34 | 34 | 'get_default_layout', 'get_related_layout', 'generate_feature_image']; |
| 35 | 35 | |
| 36 | - foreach($actions as $action) { |
|
| 37 | - \add_action('wp_ajax_wpdfi_'. $action, [$this, $action]); |
|
| 38 | - \add_action('wp_ajax_nopriv_wpdfi'. $action, [$this, $action]); |
|
| 36 | + foreach ($actions as $action) { |
|
| 37 | + \add_action('wp_ajax_wpdfi_'.$action, [$this, $action]); |
|
| 38 | + \add_action('wp_ajax_nopriv_wpdfi'.$action, [$this, $action]); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function generate_feature_image() { |
| 88 | 88 | /* security check. */ |
| 89 | - \check_ajax_referer( 'wpdfi-ajax-nonce', 'security' ); |
|
| 89 | + \check_ajax_referer('wpdfi-ajax-nonce', 'security'); |
|
| 90 | 90 | $update_fimage = \wpdfi()->post_type->update_fimage($_POST['post_id']); |
| 91 | 91 | $post_type = \get_post_type($_POST['post_id']); |
| 92 | 92 | $post_type_name = \wpdfi()->post_type->get_singular_name($post_type); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @return \VA\Templater |
| 35 | 35 | */ |
| 36 | 36 | public function get_admin_layout($tabs, $current_tab, $options, $layout_name) { |
| 37 | - return \wpdfi()->templater->render('admin.layout',[ |
|
| 37 | + return \wpdfi()->templater->render('admin.layout', [ |
|
| 38 | 38 | 'tabs' => $tabs, 'current_tab' => $current_tab, |
| 39 | 39 | 'options' => $options, 'layout_name' => $layout_name, |
| 40 | 40 | ]); |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | public function get_related_layout($section_index, $post_type) { |
| 77 | 77 | $layout = ''; |
| 78 | 78 | /* Get taxonomy layout */ |
| 79 | - $layout.= \wpdfi()->templater->render('admin.blocks.taxonomy.default', [ |
|
| 79 | + $layout .= \wpdfi()->templater->render('admin.blocks.taxonomy.default', [ |
|
| 80 | 80 | 'taxonomies' => \wpdfi()->taxonomy->get($post_type), |
| 81 | 81 | 'section_index' => $section_index |
| 82 | 82 | ]); |
| 83 | - $layout.= \wpdfi()->templater->render('admin.blocks.imageupload.default', [ |
|
| 83 | + $layout .= \wpdfi()->templater->render('admin.blocks.imageupload.default', [ |
|
| 84 | 84 | 'section_index' => $section_index |
| 85 | 85 | ]); |
| 86 | 86 | // $layout.= \wpdfi()->templater->render('admin.blocks.imagesize.default', [ |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | You should have received a copy of the GNU General Public License |
| 23 | 23 | along with WP Default Feature Image. If not, see https://www.gnu.org/licenses/gpl-2.0.html. |
| 24 | - |
|
| 25 | -*/ |
|
| 24 | + */ |
|
| 26 | 25 | |
| 27 | 26 | |
| 28 | 27 | define('WPDFI_PLUGIN', __FILE__ ); |
@@ -133,7 +132,7 @@ discard block |
||
| 133 | 132 | * @return WPDFI Singleton instance of plugin class. |
| 134 | 133 | */ |
| 135 | 134 | function wpdfi() { |
| 136 | - return WPDFI::instance(); |
|
| 135 | + return WPDFI::instance(); |
|
| 137 | 136 | } |
| 138 | 137 | |
| 139 | 138 | add_action('plugins_loaded', [wpdfi(), 'hooks']); |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | 27 | |
| 28 | -define('WPDFI_PLUGIN', __FILE__ ); |
|
| 29 | -define('WPDFI_PLUGIN_BASENAME', plugin_basename( WPDFI_PLUGIN ) ); |
|
| 30 | -define('WPDFI_URL_BASE', plugin_dir_url( WPDFI_PLUGIN) ); |
|
| 31 | -define('WPDFI_DIR_BASE', plugin_dir_path( WPDFI_PLUGIN ) ); |
|
| 32 | -define('WPDFI_ASSETS', WPDFI_URL_BASE . '/assets/' ); |
|
| 33 | -define('WPDFI_TEMPLATES_PATH', WPDFI_DIR_BASE. '/templates/'); |
|
| 28 | +define('WPDFI_PLUGIN', __FILE__); |
|
| 29 | +define('WPDFI_PLUGIN_BASENAME', plugin_basename(WPDFI_PLUGIN)); |
|
| 30 | +define('WPDFI_URL_BASE', plugin_dir_url(WPDFI_PLUGIN)); |
|
| 31 | +define('WPDFI_DIR_BASE', plugin_dir_path(WPDFI_PLUGIN)); |
|
| 32 | +define('WPDFI_ASSETS', WPDFI_URL_BASE.'/assets/'); |
|
| 33 | +define('WPDFI_TEMPLATES_PATH', WPDFI_DIR_BASE.'/templates/'); |
|
| 34 | 34 | |
| 35 | -require_once WPDFI_DIR_BASE . '/vendor/autoload.php'; |
|
| 35 | +require_once WPDFI_DIR_BASE.'/vendor/autoload.php'; |
|
| 36 | 36 | |
| 37 | 37 | use WPDFI\Traits\HasModule; |
| 38 | 38 | use WPDFI\Traits\Singleton; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | public function hooks() |
| 70 | 70 | { |
| 71 | 71 | |
| 72 | - add_action( 'init', [$this, 'init']); |
|
| 72 | + add_action('init', [$this, 'init']); |
|
| 73 | 73 | |
| 74 | 74 | /* Load all module hooks */ |
| 75 | 75 | $this->moduleHooks(); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public function install() { |
| 86 | 86 | |
| 87 | 87 | $options = get_option('wpdfi-settings'); |
| 88 | - if(!$options['options']['status_for_update']) { |
|
| 88 | + if (!$options['options']['status_for_update']) { |
|
| 89 | 89 | $options['options']['status_for_update'] = 'publish'; |
| 90 | 90 | update_option('wpdfi-settings', $options); |
| 91 | 91 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function init() |
| 102 | 102 | { |
| 103 | - load_plugin_textdomain('wpdfi', false, WPDFI_DIR_BASE . '/lang/'); |
|
| 103 | + load_plugin_textdomain('wpdfi', false, WPDFI_DIR_BASE.'/lang/'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | 'admin' => Admin::instance() |
| 119 | 119 | ]; |
| 120 | 120 | |
| 121 | - foreach($modules as $moduleName => $moduleHandle) { |
|
| 121 | + foreach ($modules as $moduleName => $moduleHandle) { |
|
| 122 | 122 | $this->module($moduleName, $moduleHandle); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -1,6 +1,6 @@ |
||
| 1 | -<form method="POST" action="<?php \admin_url( 'options-general.php?page=wpdfi-settings.php' ); ?>" id="wpdfi-form"> |
|
| 1 | +<form method="POST" action="<?php \admin_url('options-general.php?page=wpdfi-settings.php'); ?>" id="wpdfi-form"> |
|
| 2 | 2 | <div class="error-wrapper" id="error_wrapper"></div> |
| 3 | - <?php wp_nonce_field( "wpdfi-settings-page" ); ?> |
|
| 3 | + <?php wp_nonce_field("wpdfi-settings-page"); ?> |
|
| 4 | 4 | <div class="wpdfi-content"> |
| 5 | 5 | <div class="wpdfi-content-inner clearfix"> |
| 6 | 6 | @if($current_tab == 'sections') |