@@ -17,39 +17,39 @@ |
||
| 17 | 17 | <?php |
| 18 | 18 | |
| 19 | 19 | // Enqueue wp.media functions. |
| 20 | - wp_enqueue_media(); |
|
| 21 | - |
|
| 22 | - // Enqueue styles and scripts. |
|
| 23 | - wp_enqueue_style( 'wl-font-awesome', plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'css/font-awesome.min.css' ); |
|
| 24 | - wp_enqueue_style( 'wordlift-admin-setup', plugin_dir_url( dirname( __FILE__ ) ) . 'css/wordlift-admin-setup.css', array( |
|
| 25 | - 'wp-admin', |
|
| 26 | - 'wl-font-awesome', |
|
| 27 | - ) ); |
|
| 28 | - wp_enqueue_script( 'wordlift-admin-setup', plugin_dir_url( dirname( __FILE__ ) ) . 'js/1/setup.js', array( 'jquery' ) ); |
|
| 29 | - |
|
| 30 | - //Get wp_permalink structure |
|
| 31 | - $permalink_structure = get_option( 'permalink_structure' ); |
|
| 32 | - |
|
| 33 | - // Set configuration settings. |
|
| 34 | - wp_localize_script( 'wordlift-admin-setup', '_wlAdminSetup', array( |
|
| 35 | - 'ajaxUrl' => parse_url( self_admin_url( 'admin-ajax.php' ), PHP_URL_PATH ), |
|
| 36 | - 'action' => 'wl_validate_key', |
|
| 37 | - 'permalink' => $permalink_structure, |
|
| 38 | - 'media' => array( |
|
| 39 | - 'title' => __( 'WordLift Choose Logo', 'wordlift' ), |
|
| 40 | - 'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ), |
|
| 41 | - ), |
|
| 42 | - ) ); |
|
| 43 | - |
|
| 44 | - // Finally print styles and scripts. |
|
| 45 | - do_action( 'admin_print_scripts' ); |
|
| 46 | - wp_print_styles(); |
|
| 47 | - wp_print_scripts(); |
|
| 48 | - |
|
| 49 | - for ( $i = 1; $i <= 6; $i ++ ) { |
|
| 50 | - include 'admin-setup/step-' . $i . '.php'; |
|
| 51 | - } |
|
| 52 | - ?> |
|
| 20 | + wp_enqueue_media(); |
|
| 21 | + |
|
| 22 | + // Enqueue styles and scripts. |
|
| 23 | + wp_enqueue_style( 'wl-font-awesome', plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'css/font-awesome.min.css' ); |
|
| 24 | + wp_enqueue_style( 'wordlift-admin-setup', plugin_dir_url( dirname( __FILE__ ) ) . 'css/wordlift-admin-setup.css', array( |
|
| 25 | + 'wp-admin', |
|
| 26 | + 'wl-font-awesome', |
|
| 27 | + ) ); |
|
| 28 | + wp_enqueue_script( 'wordlift-admin-setup', plugin_dir_url( dirname( __FILE__ ) ) . 'js/1/setup.js', array( 'jquery' ) ); |
|
| 29 | + |
|
| 30 | + //Get wp_permalink structure |
|
| 31 | + $permalink_structure = get_option( 'permalink_structure' ); |
|
| 32 | + |
|
| 33 | + // Set configuration settings. |
|
| 34 | + wp_localize_script( 'wordlift-admin-setup', '_wlAdminSetup', array( |
|
| 35 | + 'ajaxUrl' => parse_url( self_admin_url( 'admin-ajax.php' ), PHP_URL_PATH ), |
|
| 36 | + 'action' => 'wl_validate_key', |
|
| 37 | + 'permalink' => $permalink_structure, |
|
| 38 | + 'media' => array( |
|
| 39 | + 'title' => __( 'WordLift Choose Logo', 'wordlift' ), |
|
| 40 | + 'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ), |
|
| 41 | + ), |
|
| 42 | + ) ); |
|
| 43 | + |
|
| 44 | + // Finally print styles and scripts. |
|
| 45 | + do_action( 'admin_print_scripts' ); |
|
| 46 | + wp_print_styles(); |
|
| 47 | + wp_print_scripts(); |
|
| 48 | + |
|
| 49 | + for ( $i = 1; $i <= 6; $i ++ ) { |
|
| 50 | + include 'admin-setup/step-' . $i . '.php'; |
|
| 51 | + } |
|
| 52 | + ?> |
|
| 53 | 53 | </head> |
| 54 | 54 | <body> |
| 55 | 55 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | <!-- Defining responsive ambient. --> |
| 13 | 13 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 14 | 14 | |
| 15 | - <title><?php esc_html_e( 'WordLift Setup', 'wordlift' ); ?></title> |
|
| 15 | + <title><?php esc_html_e('WordLift Setup', 'wordlift'); ?></title> |
|
| 16 | 16 | |
| 17 | 17 | <?php |
| 18 | 18 | |
@@ -20,34 +20,34 @@ discard block |
||
| 20 | 20 | wp_enqueue_media(); |
| 21 | 21 | |
| 22 | 22 | // Enqueue styles and scripts. |
| 23 | - wp_enqueue_style( 'wl-font-awesome', plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'css/font-awesome.min.css' ); |
|
| 24 | - wp_enqueue_style( 'wordlift-admin-setup', plugin_dir_url( dirname( __FILE__ ) ) . 'css/wordlift-admin-setup.css', array( |
|
| 23 | + wp_enqueue_style('wl-font-awesome', plugin_dir_url(dirname(dirname(__FILE__))).'css/font-awesome.min.css'); |
|
| 24 | + wp_enqueue_style('wordlift-admin-setup', plugin_dir_url(dirname(__FILE__)).'css/wordlift-admin-setup.css', array( |
|
| 25 | 25 | 'wp-admin', |
| 26 | 26 | 'wl-font-awesome', |
| 27 | - ) ); |
|
| 28 | - wp_enqueue_script( 'wordlift-admin-setup', plugin_dir_url( dirname( __FILE__ ) ) . 'js/1/setup.js', array( 'jquery' ) ); |
|
| 27 | + )); |
|
| 28 | + wp_enqueue_script('wordlift-admin-setup', plugin_dir_url(dirname(__FILE__)).'js/1/setup.js', array('jquery')); |
|
| 29 | 29 | |
| 30 | 30 | //Get wp_permalink structure |
| 31 | - $permalink_structure = get_option( 'permalink_structure' ); |
|
| 31 | + $permalink_structure = get_option('permalink_structure'); |
|
| 32 | 32 | |
| 33 | 33 | // Set configuration settings. |
| 34 | - wp_localize_script( 'wordlift-admin-setup', '_wlAdminSetup', array( |
|
| 35 | - 'ajaxUrl' => parse_url( self_admin_url( 'admin-ajax.php' ), PHP_URL_PATH ), |
|
| 34 | + wp_localize_script('wordlift-admin-setup', '_wlAdminSetup', array( |
|
| 35 | + 'ajaxUrl' => parse_url(self_admin_url('admin-ajax.php'), PHP_URL_PATH), |
|
| 36 | 36 | 'action' => 'wl_validate_key', |
| 37 | 37 | 'permalink' => $permalink_structure, |
| 38 | 38 | 'media' => array( |
| 39 | - 'title' => __( 'WordLift Choose Logo', 'wordlift' ), |
|
| 40 | - 'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ), |
|
| 39 | + 'title' => __('WordLift Choose Logo', 'wordlift'), |
|
| 40 | + 'button' => array('text' => __('Choose Logo', 'wordlift')), |
|
| 41 | 41 | ), |
| 42 | - ) ); |
|
| 42 | + )); |
|
| 43 | 43 | |
| 44 | 44 | // Finally print styles and scripts. |
| 45 | - do_action( 'admin_print_scripts' ); |
|
| 45 | + do_action('admin_print_scripts'); |
|
| 46 | 46 | wp_print_styles(); |
| 47 | 47 | wp_print_scripts(); |
| 48 | 48 | |
| 49 | - for ( $i = 1; $i <= 6; $i ++ ) { |
|
| 50 | - include 'admin-setup/step-' . $i . '.php'; |
|
| 49 | + for ($i = 1; $i <= 6; $i++) { |
|
| 50 | + include 'admin-setup/step-'.$i.'.php'; |
|
| 51 | 51 | } |
| 52 | 52 | ?> |
| 53 | 53 | </head> |
@@ -55,27 +55,27 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | <div class="wl-container"> |
| 57 | 57 | |
| 58 | - <a href="<?php echo esc_url( admin_url() ); ?>" |
|
| 58 | + <a href="<?php echo esc_url(admin_url()); ?>" |
|
| 59 | 59 | class="fa fa-times wl-close"></a> |
| 60 | 60 | |
| 61 | 61 | <header> |
| 62 | 62 | <h1><img class="wizard-logo" |
| 63 | - src="<?php echo plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'images/logo-wl-transparent-240x90.png'; ?>"/> |
|
| 63 | + src="<?php echo plugin_dir_url(dirname(dirname(__FILE__))).'images/logo-wl-transparent-240x90.png'; ?>"/> |
|
| 64 | 64 | </h1> |
| 65 | 65 | <img class="shapes" |
| 66 | - src="<?php echo plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'images/shapes.png'; ?>"/> |
|
| 66 | + src="<?php echo plugin_dir_url(dirname(dirname(__FILE__))).'images/shapes.png'; ?>"/> |
|
| 67 | 67 | </header> |
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | <form method="post"> |
| 71 | - <?php wp_nonce_field( 'wl-save-configuration' ); ?> |
|
| 71 | + <?php wp_nonce_field('wl-save-configuration'); ?> |
|
| 72 | 72 | <input type="hidden" name="action" value="wl-save-configuration"/> |
| 73 | 73 | <div class="viewport"></div> |
| 74 | 74 | </form> |
| 75 | 75 | |
| 76 | 76 | </div> |
| 77 | 77 | |
| 78 | -<?php do_action( 'admin_footer' ); ?> |
|
| 78 | +<?php do_action('admin_footer'); ?> |
|
| 79 | 79 | |
| 80 | 80 | </body> |
| 81 | 81 | </html> |
@@ -14,77 +14,77 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Wordlift_Tinymce_Adapter { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * The {@link Wordlift} plugin instance. |
|
| 19 | - * |
|
| 20 | - * @since 3.12.0 |
|
| 21 | - * @access private |
|
| 22 | - * @var \Wordlift $plugin The {@link Wordlift} plugin instance. |
|
| 23 | - */ |
|
| 24 | - private $plugin; |
|
| 17 | + /** |
|
| 18 | + * The {@link Wordlift} plugin instance. |
|
| 19 | + * |
|
| 20 | + * @since 3.12.0 |
|
| 21 | + * @access private |
|
| 22 | + * @var \Wordlift $plugin The {@link Wordlift} plugin instance. |
|
| 23 | + */ |
|
| 24 | + private $plugin; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Wordlift_Tinymce_Adapter constructor. |
|
| 28 | - * |
|
| 29 | - * @param \Wordlift $plugin The {@link Wordlift} plugin instance. |
|
| 30 | - */ |
|
| 31 | - public function __construct( $plugin ) { |
|
| 26 | + /** |
|
| 27 | + * Wordlift_Tinymce_Adapter constructor. |
|
| 28 | + * |
|
| 29 | + * @param \Wordlift $plugin The {@link Wordlift} plugin instance. |
|
| 30 | + */ |
|
| 31 | + public function __construct( $plugin ) { |
|
| 32 | 32 | |
| 33 | - $this->plugin = $plugin; |
|
| 33 | + $this->plugin = $plugin; |
|
| 34 | 34 | |
| 35 | - } |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Load the TinyMCE plugin. This method is called by the WP mce_external_plugins hook. |
|
| 39 | - * |
|
| 40 | - * @param array $plugins The existing plugins array. |
|
| 41 | - * |
|
| 42 | - * @return array The modified plugins array. |
|
| 43 | - * @since 3.12.0 |
|
| 44 | - */ |
|
| 45 | - function mce_external_plugins( $plugins ) { |
|
| 37 | + /** |
|
| 38 | + * Load the TinyMCE plugin. This method is called by the WP mce_external_plugins hook. |
|
| 39 | + * |
|
| 40 | + * @param array $plugins The existing plugins array. |
|
| 41 | + * |
|
| 42 | + * @return array The modified plugins array. |
|
| 43 | + * @since 3.12.0 |
|
| 44 | + */ |
|
| 45 | + function mce_external_plugins( $plugins ) { |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Bail out if you are on Media Library |
|
| 49 | - * |
|
| 50 | - * @since 3.27.1 |
|
| 51 | - * |
|
| 52 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1122 |
|
| 53 | - */ |
|
| 54 | - if ( get_current_screen()->base === 'upload' ) { |
|
| 55 | - return $plugins; |
|
| 56 | - } |
|
| 47 | + /** |
|
| 48 | + * Bail out if you are on Media Library |
|
| 49 | + * |
|
| 50 | + * @since 3.27.1 |
|
| 51 | + * |
|
| 52 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1122 |
|
| 53 | + */ |
|
| 54 | + if ( get_current_screen()->base === 'upload' ) { |
|
| 55 | + return $plugins; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - /* |
|
| 58 | + /* |
|
| 59 | 59 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
| 60 | 60 | * |
| 61 | 61 | * @since 3.20.3 |
| 62 | 62 | * |
| 63 | 63 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 64 | 64 | */ |
| 65 | - if ( ! apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 66 | - return $plugins; |
|
| 67 | - } |
|
| 65 | + if ( ! apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 66 | + return $plugins; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - // Get WordLift's version as a cache killer. |
|
| 70 | - $version = $this->plugin->get_version(); |
|
| 69 | + // Get WordLift's version as a cache killer. |
|
| 70 | + $version = $this->plugin->get_version(); |
|
| 71 | 71 | |
| 72 | - // User can edit? |
|
| 73 | - $can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); |
|
| 72 | + // User can edit? |
|
| 73 | + $can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); |
|
| 74 | 74 | |
| 75 | - // If user can't edit or rich editing isn't enabled, bail out. |
|
| 76 | - if ( ! $can_edit || ! get_user_option( 'rich_editing' ) ) { |
|
| 77 | - return $plugins; |
|
| 78 | - } |
|
| 75 | + // If user can't edit or rich editing isn't enabled, bail out. |
|
| 76 | + if ( ! $can_edit || ! get_user_option( 'rich_editing' ) ) { |
|
| 77 | + return $plugins; |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - // Add our own JavaScript file to TinyMCE's extensions. |
|
| 81 | - // DO NOT use the minified version, it'll yield errors with AngularJS. |
|
| 82 | - $plugins['wordlift'] = plugin_dir_url( dirname( __FILE__ ) ) . 'js/wordlift-reloaded.js?ver=' . $version; |
|
| 83 | - $plugins['wl_shortcodes'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/wordlift_shortcode_tinymce_plugin.js?ver=' . $version; |
|
| 84 | - $plugins['wl_tinymce'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/1/tinymce.js?ver=' . $version; |
|
| 85 | - $plugins['wl_tinymce_2'] = plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/tiny-mce.js?ver=' . $version; |
|
| 80 | + // Add our own JavaScript file to TinyMCE's extensions. |
|
| 81 | + // DO NOT use the minified version, it'll yield errors with AngularJS. |
|
| 82 | + $plugins['wordlift'] = plugin_dir_url( dirname( __FILE__ ) ) . 'js/wordlift-reloaded.js?ver=' . $version; |
|
| 83 | + $plugins['wl_shortcodes'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/wordlift_shortcode_tinymce_plugin.js?ver=' . $version; |
|
| 84 | + $plugins['wl_tinymce'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/1/tinymce.js?ver=' . $version; |
|
| 85 | + $plugins['wl_tinymce_2'] = plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/tiny-mce.js?ver=' . $version; |
|
| 86 | 86 | |
| 87 | - return $plugins; |
|
| 88 | - } |
|
| 87 | + return $plugins; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | 90 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @param \Wordlift $plugin The {@link Wordlift} plugin instance. |
| 30 | 30 | */ |
| 31 | - public function __construct( $plugin ) { |
|
| 31 | + public function __construct($plugin) { |
|
| 32 | 32 | |
| 33 | 33 | $this->plugin = $plugin; |
| 34 | 34 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @return array The modified plugins array. |
| 43 | 43 | * @since 3.12.0 |
| 44 | 44 | */ |
| 45 | - function mce_external_plugins( $plugins ) { |
|
| 45 | + function mce_external_plugins($plugins) { |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * Bail out if you are on Media Library |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @see https://github.com/insideout10/wordlift-plugin/issues/1122 |
| 53 | 53 | */ |
| 54 | - if ( get_current_screen()->base === 'upload' ) { |
|
| 54 | + if (get_current_screen()->base === 'upload') { |
|
| 55 | 55 | return $plugins; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * |
| 63 | 63 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 64 | 64 | */ |
| 65 | - if ( ! apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 65 | + if ( ! apply_filters('wl_can_see_classification_box', true)) { |
|
| 66 | 66 | return $plugins; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -70,19 +70,19 @@ discard block |
||
| 70 | 70 | $version = $this->plugin->get_version(); |
| 71 | 71 | |
| 72 | 72 | // User can edit? |
| 73 | - $can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); |
|
| 73 | + $can_edit = current_user_can('edit_posts') || current_user_can('edit_pages'); |
|
| 74 | 74 | |
| 75 | 75 | // If user can't edit or rich editing isn't enabled, bail out. |
| 76 | - if ( ! $can_edit || ! get_user_option( 'rich_editing' ) ) { |
|
| 76 | + if ( ! $can_edit || ! get_user_option('rich_editing')) { |
|
| 77 | 77 | return $plugins; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // Add our own JavaScript file to TinyMCE's extensions. |
| 81 | 81 | // DO NOT use the minified version, it'll yield errors with AngularJS. |
| 82 | - $plugins['wordlift'] = plugin_dir_url( dirname( __FILE__ ) ) . 'js/wordlift-reloaded.js?ver=' . $version; |
|
| 83 | - $plugins['wl_shortcodes'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/wordlift_shortcode_tinymce_plugin.js?ver=' . $version; |
|
| 84 | - $plugins['wl_tinymce'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/1/tinymce.js?ver=' . $version; |
|
| 85 | - $plugins['wl_tinymce_2'] = plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/tiny-mce.js?ver=' . $version; |
|
| 82 | + $plugins['wordlift'] = plugin_dir_url(dirname(__FILE__)).'js/wordlift-reloaded.js?ver='.$version; |
|
| 83 | + $plugins['wl_shortcodes'] = plugin_dir_url(dirname(__FILE__)).'admin/js/wordlift_shortcode_tinymce_plugin.js?ver='.$version; |
|
| 84 | + $plugins['wl_tinymce'] = plugin_dir_url(dirname(__FILE__)).'admin/js/1/tinymce.js?ver='.$version; |
|
| 85 | + $plugins['wl_tinymce_2'] = plugin_dir_url(dirname(__FILE__)).'js/dist/tiny-mce.js?ver='.$version; |
|
| 86 | 86 | |
| 87 | 87 | return $plugins; |
| 88 | 88 | } |