@@ -43,23 +43,23 @@ discard block |
||
43 | 43 | $plugin = lasso::get_instance(); |
44 | 44 | $this->plugin_slug = $plugin->get_plugin_slug(); |
45 | 45 | |
46 | - add_action( 'admin_head', array( $this, 'admin_assets' ) ); |
|
47 | - add_action( 'admin_notices', array( $this, 'license_nag' ) ); |
|
48 | - add_action( 'admin_head', array( $this, 'dismiss_nag' ) ); |
|
49 | - add_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), 10, 2 ); |
|
46 | + add_action('admin_head', array($this, 'admin_assets')); |
|
47 | + add_action('admin_notices', array($this, 'license_nag')); |
|
48 | + add_action('admin_head', array($this, 'dismiss_nag')); |
|
49 | + add_filter('plugin_row_meta', array($this, 'plugin_meta'), 10, 2); |
|
50 | 50 | |
51 | - if ( !class_exists( 'EDD_SL_Plugin_Updater' ) ) { |
|
51 | + if (!class_exists('EDD_SL_Plugin_Updater')) { |
|
52 | 52 | include LASSO_DIR.'admin/includes/EDD_SL_Plugin_Updater.php'; |
53 | 53 | } |
54 | 54 | |
55 | - if ( !class_exists( 'TGM_Plugin_Activation' ) ) { |
|
55 | + if (!class_exists('TGM_Plugin_Activation')) { |
|
56 | 56 | include LASSO_DIR.'admin/includes/class-tgm-plugin-activation.php'; |
57 | 57 | } |
58 | 58 | |
59 | 59 | new menus\welcome(); |
60 | 60 | new menus\settings(); |
61 | 61 | |
62 | - if ( !defined( 'LASSO_AGENCY_MODE' ) ) { |
|
62 | + if (!defined('LASSO_AGENCY_MODE')) { |
|
63 | 63 | new menus\license(); |
64 | 64 | } |
65 | 65 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public static function get_instance() { |
76 | 76 | |
77 | 77 | // If the single instance hasn't been set, set it now. |
78 | - if ( null == self::$instance ) { |
|
78 | + if (null == self::$instance) { |
|
79 | 79 | self::$instance = new self; |
80 | 80 | } |
81 | 81 | |
@@ -97,13 +97,13 @@ discard block |
||
97 | 97 | 'dashboard_page_lasso-welcome-screen' |
98 | 98 | ); |
99 | 99 | |
100 | - foreach ( $pages as $page ) { |
|
100 | + foreach ($pages as $page) { |
|
101 | 101 | wp_enqueue_media(); |
102 | - wp_enqueue_style( 'wp-color-picker'); |
|
103 | - wp_enqueue_script( 'wp-color-picker'); |
|
102 | + wp_enqueue_style('wp-color-picker'); |
|
103 | + wp_enqueue_script('wp-color-picker'); |
|
104 | 104 | |
105 | - wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery','wp-color-picker' ), LASSO_VERSION, true ); |
|
106 | - wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION ); |
|
105 | + wp_enqueue_script('lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array('jquery', 'wp-color-picker'), LASSO_VERSION, true); |
|
106 | + wp_enqueue_style('lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
@@ -116,15 +116,15 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @return array new array of links for our plugin listing on plugins.php |
118 | 118 | */ |
119 | - public function plugin_meta( $links, $file ) { |
|
119 | + public function plugin_meta($links, $file) { |
|
120 | 120 | |
121 | - if ( strpos( $file, 'lasso.php' ) !== false && !defined( 'LASSO_AGENCY_MODE' ) ) { |
|
121 | + if (strpos($file, 'lasso.php') !== false && !defined('LASSO_AGENCY_MODE')) { |
|
122 | 122 | |
123 | 123 | $new_links = array( |
124 | 124 | '<a href="http://edituswp.com/help" target="_blank">Help</a>' |
125 | 125 | ); |
126 | 126 | |
127 | - $links = array_merge( $links, $new_links ); |
|
127 | + $links = array_merge($links, $new_links); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | return $links; |
@@ -136,35 +136,35 @@ discard block |
||
136 | 136 | * @since 0.9.7 |
137 | 137 | * @todo make dismissible |
138 | 138 | */ |
139 | - public function license_nag(){ |
|
139 | + public function license_nag() { |
|
140 | 140 | |
141 | - $screen = get_current_screen(); |
|
142 | - $welcome = 'toplevel_page_lasso-editor' == $screen->id; |
|
143 | - $license = get_option( 'lasso_license_key' ); |
|
144 | - $status = get_option( 'lasso_license_status' ); |
|
141 | + $screen = get_current_screen(); |
|
142 | + $welcome = 'toplevel_page_lasso-editor' == $screen->id; |
|
143 | + $license = get_option('lasso_license_key'); |
|
144 | + $status = get_option('lasso_license_status'); |
|
145 | 145 | |
146 | - $message_empty = apply_filters('lasso_empty_license_message','Your license key for support and automatic updates for Editus is missing!'); |
|
147 | - $message_invalid = apply_filters('lasso_invalid_license_message','Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.'); |
|
148 | - $message_inactive = apply_filters('lasso_inactive_license_message','It looks like your license key has not yet been activated.'); |
|
146 | + $message_empty = apply_filters('lasso_empty_license_message', 'Your license key for support and automatic updates for Editus is missing!'); |
|
147 | + $message_invalid = apply_filters('lasso_invalid_license_message', 'Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.'); |
|
148 | + $message_inactive = apply_filters('lasso_inactive_license_message', 'It looks like your license key has not yet been activated.'); |
|
149 | 149 | |
150 | - $license_link = sprintf('<a href="%s">Update License</a>', esc_url( add_query_arg( array( 'page' => 'lasso-license' ), admin_url('admin.php') ) ) ); |
|
151 | - $dismiss_link = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url( add_query_arg( 'lasso-notice', 'dismiss' ) ), __('Dismiss this notice.','lasso') ); |
|
150 | + $license_link = sprintf('<a href="%s">Update License</a>', esc_url(add_query_arg(array('page' => 'lasso-license'), admin_url('admin.php')))); |
|
151 | + $dismiss_link = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url(add_query_arg('lasso-notice', 'dismiss')), __('Dismiss this notice.', 'lasso')); |
|
152 | 152 | |
153 | - $not_hidden = get_user_meta( get_current_user_ID(), 'lasso_license_nag_dismissed', true ); |
|
153 | + $not_hidden = get_user_meta(get_current_user_ID(), 'lasso_license_nag_dismissed', true); |
|
154 | 154 | |
155 | - if ( current_user_can('manage_options') && !$welcome && !defined( 'LASSO_AGENCY_MODE') && !$not_hidden ) { |
|
155 | + if (current_user_can('manage_options') && !$welcome && !defined('LASSO_AGENCY_MODE') && !$not_hidden) { |
|
156 | 156 | |
157 | - if ( empty( $license ) ) { |
|
157 | + if (empty($license)) { |
|
158 | 158 | |
159 | - printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link ); |
|
159 | + printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link); |
|
160 | 160 | |
161 | - } else if ( 'invalid' == $status ){ // license key entered wrong or something |
|
161 | + } else if ('invalid' == $status) { // license key entered wrong or something |
|
162 | 162 | |
163 | - printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link ); |
|
163 | + printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link, $dismiss_link); |
|
164 | 164 | |
165 | - } else if ( empty( $status ) ){ // license key saved but not activated |
|
165 | + } else if (empty($status)) { // license key saved but not activated |
|
166 | 166 | |
167 | - printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link ); |
|
167 | + printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link); |
|
168 | 168 | |
169 | 169 | } |
170 | 170 | } |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function dismiss_nag() { |
180 | 180 | |
181 | - if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) { |
|
182 | - update_user_meta( get_current_user_id(), 'lasso_license_nag_dismissed', 1 ); |
|
181 | + if (isset($_GET['lasso-notice']) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options')) { |
|
182 | + update_user_meta(get_current_user_id(), 'lasso_license_nag_dismissed', 1); |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | } |
@@ -52,28 +52,28 @@ discard block |
||
52 | 52 | * @param string $method The name of the callback method. |
53 | 53 | |
54 | 54 | */ |
55 | - public function __construct( $action, $callback_class) { |
|
56 | - if ( ! is_object( $callback_class ) ) { |
|
55 | + public function __construct($action, $callback_class) { |
|
56 | + if (!is_object($callback_class)) { |
|
57 | 57 | $this->callback_instance = new $callback_class; |
58 | - }else{ |
|
58 | + } else { |
|
59 | 59 | $this->callback_instance = $callback_class; |
60 | 60 | } |
61 | 61 | |
62 | - if ( $this->check_nonce() ) { |
|
63 | - if ( is_object( $this->callback_instance ) && $this->if_implements() ) { |
|
64 | - if ( $this->other_auth_checks( $action ) ) { |
|
62 | + if ($this->check_nonce()) { |
|
63 | + if (is_object($this->callback_instance) && $this->if_implements()) { |
|
64 | + if ($this->other_auth_checks($action)) { |
|
65 | 65 | $this->status_code = 200; |
66 | 66 | } else { |
67 | - $this->error_message = __( 'Unauthorized action', 'lasso' ); |
|
67 | + $this->error_message = __('Unauthorized action', 'lasso'); |
|
68 | 68 | $this->status_code = 401; |
69 | 69 | } |
70 | 70 | } else { |
71 | - $this->error_message = __( 'All callback classes used for processing the Editus Internal API must implement the lasso\internal_api\api_action interface.', 'lasso' ); |
|
71 | + $this->error_message = __('All callback classes used for processing the Editus Internal API must implement the lasso\internal_api\api_action interface.', 'lasso'); |
|
72 | 72 | $this->status_code = 401; |
73 | 73 | } |
74 | 74 | } else { |
75 | 75 | $this->status_code = 401; |
76 | - $this->error_message = __( 'Nonce invalid', 'lasso' ); |
|
76 | + $this->error_message = __('Nonce invalid', 'lasso'); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | } |
@@ -89,20 +89,20 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @return bool True if auth checks were all postive. |
91 | 91 | */ |
92 | - protected function other_auth_checks( $action ) { |
|
92 | + protected function other_auth_checks($action) { |
|
93 | 93 | $auth_callbacks = $this->callback_instance->auth_callbacks(); |
94 | 94 | |
95 | - if ( is_array( $auth_callbacks ) && isset( $auth_callbacks[ $action ] ) && is_array( $auth_callbacks[ $action ] ) ) { |
|
96 | - $checks = $auth_callbacks[ $action ]; |
|
97 | - if ( is_array( $checks ) ) { |
|
98 | - foreach ( $checks as $check ) { |
|
99 | - if ( is_array( $check ) ) { |
|
100 | - $check = call_user_func( array( $check[0], $check[1] ) ); |
|
95 | + if (is_array($auth_callbacks) && isset($auth_callbacks[$action]) && is_array($auth_callbacks[$action])) { |
|
96 | + $checks = $auth_callbacks[$action]; |
|
97 | + if (is_array($checks)) { |
|
98 | + foreach ($checks as $check) { |
|
99 | + if (is_array($check)) { |
|
100 | + $check = call_user_func(array($check[0], $check[1])); |
|
101 | 101 | } else { |
102 | - $check = call_user_func( $check ); |
|
102 | + $check = call_user_func($check); |
|
103 | 103 | } |
104 | 104 | |
105 | - if ( false === $check ) { |
|
105 | + if (false === $check) { |
|
106 | 106 | return false; |
107 | 107 | |
108 | 108 | } |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | */ |
128 | 128 | protected function if_implements() { |
129 | 129 | |
130 | - $implements = class_implements( $this->callback_instance ); |
|
131 | - if ( is_array( $implements ) && in_array( 'lasso\internal_api\api_action', $implements ) ) { |
|
130 | + $implements = class_implements($this->callback_instance); |
|
131 | + if (is_array($implements) && in_array('lasso\internal_api\api_action', $implements)) { |
|
132 | 132 | return true; |
133 | 133 | |
134 | 134 | } |
@@ -147,13 +147,13 @@ discard block |
||
147 | 147 | * @return bool |
148 | 148 | */ |
149 | 149 | protected function check_nonce() { |
150 | - if ( isset( $this->callback_instance->nonce_action ) ) { |
|
150 | + if (isset($this->callback_instance->nonce_action)) { |
|
151 | 151 | $nonce = $this->callback_instance->nonce_action; |
152 | - }else{ |
|
152 | + } else { |
|
153 | 153 | $nonce = 'lasso_editor'; |
154 | 154 | } |
155 | 155 | |
156 | - return wp_verify_nonce( $_POST[ 'nonce' ], $nonce ); |
|
156 | + return wp_verify_nonce($_POST['nonce'], $nonce); |
|
157 | 157 | |
158 | 158 | } |
159 | 159 |
@@ -24,35 +24,35 @@ discard block |
||
24 | 24 | global $wp_query; |
25 | 25 | |
26 | 26 | //get action, and if set, possibly act |
27 | - $action = $wp_query->get( 'action' ); |
|
28 | - if ( $action && strpos( $_SERVER['REQUEST_URI'], 'lasso-internal-api' ) ) { |
|
27 | + $action = $wp_query->get('action'); |
|
28 | + if ($action && strpos($_SERVER['REQUEST_URI'], 'lasso-internal-api')) { |
|
29 | 29 | |
30 | - $response = __( 'Editus API Error.', 'lasso' ); |
|
30 | + $response = __('Editus API Error.', 'lasso'); |
|
31 | 31 | $code = 400; |
32 | 32 | |
33 | 33 | //see if have a nonce. Will verify it in auth class. |
34 | - if ( isset( $_POST[ 'nonce' ] ) ) { |
|
34 | + if (isset($_POST['nonce'])) { |
|
35 | 35 | |
36 | - $callback = self::find_callback( strip_tags( $action ) ); |
|
37 | - if ( is_int( $callback ) ) { |
|
36 | + $callback = self::find_callback(strip_tags($action)); |
|
37 | + if (is_int($callback)) { |
|
38 | 38 | $code = $callback; |
39 | - }elseif( ! class_exists( $callback['class'] ) ) { |
|
39 | + }elseif (!class_exists($callback['class'])) { |
|
40 | 40 | $code = 415; |
41 | - }else { |
|
42 | - $action = str_replace( '-', '_', $action ); |
|
41 | + } else { |
|
42 | + $action = str_replace('-', '_', $action); |
|
43 | 43 | $callback_instance = new $callback['class']; |
44 | - $auth = self::auth( $action, $callback_instance, $callback['method'] ); |
|
45 | - if ( 200 == $auth->status_code && is_array( $callback ) ) { |
|
44 | + $auth = self::auth($action, $callback_instance, $callback['method']); |
|
45 | + if (200 == $auth->status_code && is_array($callback)) { |
|
46 | 46 | $code = 200; |
47 | - $data = new find_data( $callback_instance, $action ); |
|
48 | - if ( is_array( $data->data ) && ! empty( $data->data ) ) { |
|
49 | - $response = self::route( $action, $callback_instance, $callback['method'], $data->data ); |
|
47 | + $data = new find_data($callback_instance, $action); |
|
48 | + if (is_array($data->data) && !empty($data->data)) { |
|
49 | + $response = self::route($action, $callback_instance, $callback['method'], $data->data); |
|
50 | 50 | } else { |
51 | 51 | $code = 500; |
52 | 52 | } |
53 | 53 | |
54 | 54 | } else { |
55 | - if ( isset( $auth->error_message ) && is_string( $auth->error_message ) ) { |
|
55 | + if (isset($auth->error_message) && is_string($auth->error_message)) { |
|
56 | 56 | $response = $auth->error_message; |
57 | 57 | } |
58 | 58 | |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | |
62 | 62 | } |
63 | 63 | |
64 | - }else{ |
|
64 | + } else { |
|
65 | 65 | $code = 401; |
66 | - $response = __( 'Nonce not set.', 'lasso' ); |
|
66 | + $response = __('Nonce not set.', 'lasso'); |
|
67 | 67 | } |
68 | 68 | |
69 | - self::respond( $response, $code ); |
|
69 | + self::respond($response, $code); |
|
70 | 70 | |
71 | 71 | } |
72 | 72 | |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return \lasso\internal_api\auth |
87 | 87 | */ |
88 | - protected static function auth( $action, $callback ) { |
|
89 | - return new auth( $action, $callback ); |
|
88 | + protected static function auth($action, $callback) { |
|
89 | + return new auth($action, $callback); |
|
90 | 90 | |
91 | 91 | } |
92 | 92 | |
@@ -99,15 +99,15 @@ discard block |
||
99 | 99 | * |
100 | 100 | * @return array |
101 | 101 | */ |
102 | - protected static function find_callback( $action ) { |
|
103 | - if ( $action ) { |
|
104 | - $parts = explode( '_', $action ); |
|
102 | + protected static function find_callback($action) { |
|
103 | + if ($action) { |
|
104 | + $parts = explode('_', $action); |
|
105 | 105 | |
106 | - if ( isset( $parts[0] ) && isset( $parts[1] ) && isset( $parts[2] ) ) { |
|
107 | - $class = str_replace( '-', '_', $parts[1] ); |
|
106 | + if (isset($parts[0]) && isset($parts[1]) && isset($parts[2])) { |
|
107 | + $class = str_replace('-', '_', $parts[1]); |
|
108 | 108 | |
109 | 109 | $class = "\\lasso\\{$parts[0]}\\{$class}"; |
110 | - $callback = str_replace( '-', '_', $parts[2] ); |
|
110 | + $callback = str_replace('-', '_', $parts[2]); |
|
111 | 111 | |
112 | 112 | return array( |
113 | 113 | 'class' => $class, |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | * |
137 | 137 | * @return mixed |
138 | 138 | */ |
139 | - protected static function route( $action, $callback, $method, $data ) { |
|
140 | - if ( method_exists( $callback, $method ) ) { |
|
141 | - $response = call_user_func( array( $callback, $method ), $data ); |
|
139 | + protected static function route($action, $callback, $method, $data) { |
|
140 | + if (method_exists($callback, $method)) { |
|
141 | + $response = call_user_func(array($callback, $method), $data); |
|
142 | 142 | |
143 | 143 | return $response; |
144 | 144 | |
@@ -156,29 +156,29 @@ discard block |
||
156 | 156 | * @param array|string $response The response message to send. |
157 | 157 | * @param bool|int $code Response code or bool. If is bool, response code will be 200 or 401 |
158 | 158 | */ |
159 | - protected static function respond( $response, $code ) { |
|
160 | - if ( true === $code ) { |
|
159 | + protected static function respond($response, $code) { |
|
160 | + if (true === $code) { |
|
161 | 161 | $code = 200; |
162 | 162 | } |
163 | 163 | |
164 | - if ( false == $code ) { |
|
164 | + if (false == $code) { |
|
165 | 165 | $code = 401; |
166 | 166 | } |
167 | 167 | |
168 | - if ( is_string( $response ) ) { |
|
168 | + if (is_string($response)) { |
|
169 | 169 | $data[] = $response; |
170 | - }elseif( is_array( $response ) ) { |
|
170 | + }elseif (is_array($response)) { |
|
171 | 171 | $data = $response; |
172 | - }else{ |
|
172 | + } else { |
|
173 | 173 | $data[] = $code; |
174 | 174 | } |
175 | 175 | |
176 | - status_header( $code ); |
|
176 | + status_header($code); |
|
177 | 177 | nocache_headers(); |
178 | - if ( 200 == $code ) { |
|
179 | - wp_send_json_success( $data ); |
|
180 | - }else{ |
|
181 | - wp_send_json_error( $data ); |
|
178 | + if (200 == $code) { |
|
179 | + wp_send_json_success($data); |
|
180 | + } else { |
|
181 | + wp_send_json_error($data); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public static function init() { |
202 | 202 | |
203 | - if ( ! self::$instance ) { |
|
203 | + if (!self::$instance) { |
|
204 | 204 | self::$instance = new self; |
205 | 205 | } |
206 | 206 |
@@ -15,21 +15,21 @@ |
||
15 | 15 | * |
16 | 16 | * @param array $fields |
17 | 17 | */ |
18 | - public function __construct( $fields ) { |
|
18 | + public function __construct($fields) { |
|
19 | 19 | $this->fields = $fields; |
20 | - add_filter( 'lasso_api_params', function( $params ) { |
|
21 | - foreach( $this->fields as $field => $cbs ) { |
|
20 | + add_filter('lasso_api_params', function($params) { |
|
21 | + foreach ($this->fields as $field => $cbs) { |
|
22 | 22 | //$field = lasso_clean_string( $field ); |
23 | - $params[ 'process_meta_update' ][ $field ] = $cbs; |
|
23 | + $params['process_meta_update'][$field] = $cbs; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | return $params; |
27 | 27 | |
28 | 28 | }); |
29 | 29 | |
30 | - add_filter( 'lasso_meta_fields', function( $allowed ) { |
|
30 | + add_filter('lasso_meta_fields', function($allowed) { |
|
31 | 31 | |
32 | - foreach( array_keys( $this->fields ) as $field ) { |
|
32 | + foreach (array_keys($this->fields) as $field) { |
|
33 | 33 | //$field = lasso_clean_string( $field ); |
34 | 34 | $allowed[] = $field; |
35 | 35 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * Get an array of addon data for the settings modal |
44 | 44 | * @since 0.9.4 |
45 | 45 | */ |
46 | -function lasso_get_modal_tabs(){ |
|
46 | +function lasso_get_modal_tabs() { |
|
47 | 47 | |
48 | 48 | $tabs = array(); |
49 | 49 | |
@@ -60,34 +60,34 @@ discard block |
||
60 | 60 | * @uses lasso_modal_addons_content() |
61 | 61 | * @since 0.9.4 |
62 | 62 | */ |
63 | -function lasso_modal_addons( $type = 'tab' ){ |
|
63 | +function lasso_modal_addons($type = 'tab') { |
|
64 | 64 | |
65 | 65 | $tabs = lasso_get_modal_tabs(); |
66 | 66 | $out = ''; |
67 | 67 | |
68 | - if ( $tabs ): |
|
68 | + if ($tabs): |
|
69 | 69 | |
70 | - if ( 'tab' == $type ) { |
|
70 | + if ('tab' == $type) { |
|
71 | 71 | |
72 | 72 | $out = '<ul class="lasso--modal__tabs">'; |
73 | 73 | |
74 | 74 | $out .= '<li class="active-tab" data-addon-name="core">Editus</li>'; |
75 | 75 | |
76 | - foreach ( $tabs as $tab ) { |
|
76 | + foreach ($tabs as $tab) { |
|
77 | 77 | |
78 | - if ( isset( $tab ) ) { |
|
78 | + if (isset($tab)) { |
|
79 | 79 | |
80 | - $out .= lasso_modal_addons_content( $tab, $type ); |
|
80 | + $out .= lasso_modal_addons_content($tab, $type); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | 84 | $out .= '</ul>'; |
85 | 85 | |
86 | - } elseif ( 'content' == $type ) { |
|
87 | - foreach ( $tabs as $tab ) { |
|
86 | + } elseif ('content' == $type) { |
|
87 | + foreach ($tabs as $tab) { |
|
88 | 88 | |
89 | - if ( isset( $tab ) ) { |
|
90 | - $out .= lasso_modal_addons_content( $tab , $type ); |
|
89 | + if (isset($tab)) { |
|
90 | + $out .= lasso_modal_addons_content($tab, $type); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | endif; |
97 | 97 | |
98 | - return !empty( $out ) ? $out : false; |
|
98 | + return !empty($out) ? $out : false; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -115,26 +115,26 @@ discard block |
||
115 | 115 | * @since 0.9.5 |
116 | 116 | * @subpackage lasso_modal_addons_content |
117 | 117 | */ |
118 | -function lasso_option_form( $name = '', $options = array() ){ |
|
118 | +function lasso_option_form($name = '', $options = array()) { |
|
119 | 119 | |
120 | 120 | ob_start(); |
121 | 121 | |
122 | - if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) |
|
122 | + if (empty($name) || empty($options) || !is_array($options)) |
|
123 | 123 | return; |
124 | 124 | |
125 | 125 | $nonce = wp_create_nonce('lasso-process-post-meta'); |
126 | - $key = sprintf('_lasso_%s_settings', $name ); |
|
126 | + $key = sprintf('_lasso_%s_settings', $name); |
|
127 | 127 | |
128 | - $out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">' ); |
|
128 | + $out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">'); |
|
129 | 129 | |
130 | - $out .= lasso_option_fields( $name, $options ); |
|
131 | - $out .='<div class="form--bottom">'; |
|
132 | - $out .='<input type="submit" value="'.__( 'Save', 'lasso' ).'">'; |
|
133 | - $out .='<input type="hidden" name="tab_name" value="'.$key.'">'; |
|
134 | - $out .='<input type="hidden" name="post_id" value="'.get_the_ID().'">'; |
|
135 | - $out .='<input type="hidden" name="nonce" value="'.$nonce.'">'; |
|
136 | - $out .='<input type="hidden" name="action" value="process_meta_update">'; |
|
137 | - $out .='</div>'; |
|
130 | + $out .= lasso_option_fields($name, $options); |
|
131 | + $out .= '<div class="form--bottom">'; |
|
132 | + $out .= '<input type="submit" value="'.__('Save', 'lasso').'">'; |
|
133 | + $out .= '<input type="hidden" name="tab_name" value="'.$key.'">'; |
|
134 | + $out .= '<input type="hidden" name="post_id" value="'.get_the_ID().'">'; |
|
135 | + $out .= '<input type="hidden" name="nonce" value="'.$nonce.'">'; |
|
136 | + $out .= '<input type="hidden" name="action" value="process_meta_update">'; |
|
137 | + $out .= '</div>'; |
|
138 | 138 | |
139 | 139 | $out .= '</form>'; |
140 | 140 | |
@@ -192,20 +192,20 @@ discard block |
||
192 | 192 | * @since 0.9.5 |
193 | 193 | * @subpackage lasso_modal_addons_content |
194 | 194 | */ |
195 | -function lasso_option_fields( $name = '', $options = array() ){ |
|
195 | +function lasso_option_fields($name = '', $options = array()) { |
|
196 | 196 | |
197 | - $out = ''; |
|
197 | + $out = ''; |
|
198 | 198 | $before = '<div class="lasso--postsettings__option">'; |
199 | 199 | $after = '</div>'; |
200 | 200 | |
201 | - if ( empty( $name ) || empty( $options ) ) |
|
201 | + if (empty($name) || empty($options)) |
|
202 | 202 | return; |
203 | 203 | |
204 | - foreach ( (array) $options as $option ) { |
|
204 | + foreach ((array) $options as $option) { |
|
205 | 205 | |
206 | - $type = isset( $option['type'] ) ? $option['type'] : 'text'; |
|
206 | + $type = isset($option['type']) ? $option['type'] : 'text'; |
|
207 | 207 | |
208 | - $out .= sprintf('%s%s%s', $before, lasso_option_engine_option( $name, $option,$type ), $after ); |
|
208 | + $out .= sprintf('%s%s%s', $before, lasso_option_engine_option($name, $option, $type), $after); |
|
209 | 209 | |
210 | 210 | } |
211 | 211 | |
@@ -223,44 +223,44 @@ discard block |
||
223 | 223 | * @param $type string text, textarea, checkbox, color |
224 | 224 | * @since 5.0 |
225 | 225 | */ |
226 | -function lasso_option_engine_option( $name = '', $option = '', $type = '') { |
|
226 | +function lasso_option_engine_option($name = '', $option = '', $type = '') { |
|
227 | 227 | |
228 | - if ( empty( $type ) || empty( $option ) ) |
|
228 | + if (empty($type) || empty($option)) |
|
229 | 229 | return; |
230 | 230 | |
231 | - $id = isset( $option['id'] ) ? $option['id'] : false; |
|
231 | + $id = isset($option['id']) ? $option['id'] : false; |
|
232 | 232 | //$id = $id ? lasso_clean_string( $id ) : false; |
233 | 233 | |
234 | - $desc = isset( $option['desc'] ) ? $option['desc'] : false; |
|
234 | + $desc = isset($option['desc']) ? $option['desc'] : false; |
|
235 | 235 | |
236 | - $value = get_post_meta( get_the_id(), $option[ 'id' ], true ); |
|
236 | + $value = get_post_meta(get_the_id(), $option['id'], true); |
|
237 | 237 | |
238 | - switch ( $type ) { |
|
238 | + switch ($type) { |
|
239 | 239 | case 'text': |
240 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">',$id, esc_html( $desc ), $id, $id, $value ); |
|
240 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">', $id, esc_html($desc), $id, $id, $value); |
|
241 | 241 | break; |
242 | 242 | case 'textarea': |
243 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>',$id, esc_html( $desc ), $id, $id, $value ); |
|
243 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>', $id, esc_html($desc), $id, $id, $value); |
|
244 | 244 | break; |
245 | 245 | case 'imgurl': |
246 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image" class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image" class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>',$id, esc_html( $desc ), $value, $id, $id, $value ); |
|
246 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image" class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image" class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>', $id, esc_html($desc), $value, $id, $id, $value); |
|
247 | 247 | break; |
248 | 248 | case 'checkbox': |
249 | - $out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s',$id, $id, $id ,esc_html( $desc ) ); |
|
249 | + $out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s', $id, $id, $id, esc_html($desc)); |
|
250 | 250 | break; |
251 | 251 | case 'dropdown': |
252 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">',$id, esc_html( $desc ), $id, $id); |
|
252 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">', $id, esc_html($desc), $id, $id); |
|
253 | 253 | $options = explode(";", $option['options']); |
254 | 254 | foreach ($options as &$opt) { |
255 | 255 | $opts = explode(":", $opt); |
256 | 256 | if ($opts[0] == $value) { |
257 | - $out .= sprintf('<option value = "%s" selected>%s</option>',$opts[0], $opts[1]); |
|
257 | + $out .= sprintf('<option value = "%s" selected>%s</option>', $opts[0], $opts[1]); |
|
258 | 258 | } else { |
259 | - $out .= sprintf('<option value = "%s">%s</option>',$opts[0], $opts[1]); |
|
259 | + $out .= sprintf('<option value = "%s">%s</option>', $opts[0], $opts[1]); |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 | |
263 | - $out .='</select>'; |
|
263 | + $out .= '</select>'; |
|
264 | 264 | break; |
265 | 265 | } |
266 | 266 |
@@ -28,28 +28,28 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function save( $data ) { |
|
31 | + public function save($data) { |
|
32 | 32 | |
33 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
34 | - $locations = isset( $data['ase-map-component-locations'] ) ? $data['ase-map-component-locations'] : false; |
|
35 | - $start_point = isset( $data['ase-map-component-start-point'] ) ? $data['ase-map-component-start-point']: false; |
|
36 | - $zoom = isset( $data['ase-map-component-zoom'] ) ? $data['ase-map-component-zoom' ] : false; |
|
33 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
34 | + $locations = isset($data['ase-map-component-locations']) ? $data['ase-map-component-locations'] : false; |
|
35 | + $start_point = isset($data['ase-map-component-start-point']) ? $data['ase-map-component-start-point'] : false; |
|
36 | + $zoom = isset($data['ase-map-component-zoom']) ? $data['ase-map-component-zoom'] : false; |
|
37 | 37 | |
38 | - if ( is_array( $locations ) ) { |
|
39 | - delete_post_meta( $postid, 'ase_map_component_locations' ); |
|
38 | + if (is_array($locations)) { |
|
39 | + delete_post_meta($postid, 'ase_map_component_locations'); |
|
40 | 40 | |
41 | 41 | // update locations if set |
42 | - foreach ( $locations as $location ) { |
|
43 | - $point = json_decode( urldecode( $location ), true ); |
|
44 | - add_post_meta( $postid, 'ase_map_component_locations', $point ); |
|
42 | + foreach ($locations as $location) { |
|
43 | + $point = json_decode(urldecode($location), true); |
|
44 | + add_post_meta($postid, 'ase_map_component_locations', $point); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // udpate start point |
48 | - $point = json_decode( $start_point, true ); |
|
49 | - update_post_meta( $postid, 'ase_map_component_start_point', $point ); |
|
48 | + $point = json_decode($start_point, true); |
|
49 | + update_post_meta($postid, 'ase_map_component_start_point', $point); |
|
50 | 50 | |
51 | 51 | // update zoom |
52 | - update_post_meta( $postid, 'ase_map_component_zoom', $zoom ); |
|
52 | + update_post_meta($postid, 'ase_map_component_zoom', $zoom); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | return true; |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
65 | 65 | */ |
66 | - public static function params(){ |
|
67 | - $params[ 'process_map_save' ] = array( |
|
66 | + public static function params() { |
|
67 | + $params['process_map_save'] = array( |
|
68 | 68 | 'postid' => 'absint', |
69 | 69 | 'ase-map-component-locations' => 'lasso_sanitize_data', |
70 | 70 | 'ase-map-component-start-point' => array( |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return array Array of additional functions to use to authorize action. |
89 | 89 | */ |
90 | 90 | public static function auth_callbacks() { |
91 | - $params[ 'process_map_save' ] = array( |
|
91 | + $params['process_map_save'] = array( |
|
92 | 92 | 'lasso_user_can' |
93 | 93 | ); |
94 | 94 |
@@ -10,30 +10,30 @@ discard block |
||
10 | 10 | |
11 | 11 | function __construct() { |
12 | 12 | |
13 | - add_action( 'admin_init', array( $this, 'redirect' ) ); |
|
14 | - add_action( 'admin_menu', array( $this, 'lasso_welcome' ) ); |
|
15 | - add_action( 'network_admin_menu', array( $this, 'lasso_welcome' ) ); // CHANGED Added hook. |
|
13 | + add_action('admin_init', array($this, 'redirect')); |
|
14 | + add_action('admin_menu', array($this, 'lasso_welcome')); |
|
15 | + add_action('network_admin_menu', array($this, 'lasso_welcome')); // CHANGED Added hook. |
|
16 | 16 | |
17 | - add_action( 'tgmpa_register', array( $this,'required_plugins' )); |
|
17 | + add_action('tgmpa_register', array($this, 'required_plugins')); |
|
18 | 18 | |
19 | 19 | } |
20 | 20 | |
21 | 21 | function redirect() { |
22 | 22 | |
23 | 23 | // Bail if no activation redirect |
24 | - if ( !get_transient( '_lasso_welcome_redirect' ) ) { |
|
24 | + if (!get_transient('_lasso_welcome_redirect')) { |
|
25 | 25 | return; |
26 | 26 | } |
27 | 27 | |
28 | 28 | // Delete the redirect transient |
29 | - delete_transient( '_lasso_welcome_redirect' ); |
|
29 | + delete_transient('_lasso_welcome_redirect'); |
|
30 | 30 | |
31 | 31 | // Bail if activating from network, or bulk |
32 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
32 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
36 | - wp_safe_redirect( esc_url_raw( add_query_arg( array( 'page' => 'lasso-editor' ), admin_url( 'admin.php' ) ) ) ); |
|
36 | + wp_safe_redirect(esc_url_raw(add_query_arg(array('page' => 'lasso-editor'), admin_url('admin.php')))); |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | function lasso_welcome() { |
46 | 46 | |
47 | 47 | // CHANGED Removed condition. |
48 | - add_menu_page( __( 'Editus', 'lasso' ), __( 'Editus', 'lasso' ), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png' ); |
|
49 | - add_submenu_page( 'lasso-editor', __( 'Welcome', 'lasso' ), __( 'Status', 'lasso' ), 'manage_options', 'lasso-editor', array( $this, 'welcome' ) ); |
|
48 | + add_menu_page(__('Editus', 'lasso'), __('Editus', 'lasso'), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png'); |
|
49 | + add_submenu_page('lasso-editor', __('Welcome', 'lasso'), __('Status', 'lasso'), 'manage_options', 'lasso-editor', array($this, 'welcome')); |
|
50 | 50 | |
51 | 51 | } |
52 | 52 | |
@@ -60,24 +60,24 @@ discard block |
||
60 | 60 | ?> |
61 | 61 | <div class="wrap lasso--welcome"> |
62 | 62 | |
63 | - <?php self::header();?> |
|
63 | + <?php self::header(); ?> |
|
64 | 64 | |
65 | 65 | <ul class="lasso--welcome__steps"> |
66 | 66 | |
67 | 67 | <?php // CHANGED Added the is_network_admin condition. ?> |
68 | - <?php if ( is_network_admin() ) : ?> |
|
68 | + <?php if (is_network_admin()) : ?> |
|
69 | 69 | |
70 | 70 | <li> |
71 | - <p><?php _e( 'We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso' );?></p> |
|
71 | + <p><?php _e('We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso'); ?></p> |
|
72 | 72 | </li> |
73 | 73 | |
74 | 74 | <?php else : |
75 | 75 | |
76 | 76 | $checks = self::lasso_preflight_check(); |
77 | 77 | |
78 | - if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ): |
|
78 | + if ($checks && !defined('LASSO_AGENCY_MODE')): |
|
79 | 79 | |
80 | - foreach ( (array) $checks as $key => $check ) { |
|
80 | + foreach ((array) $checks as $key => $check) { |
|
81 | 81 | |
82 | 82 | echo $check; |
83 | 83 | } |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | // pre-flight is go for flight |
88 | 88 | ?> |
89 | 89 | <li class="success"> |
90 | - <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3> |
|
91 | - <?php if ( lasso_get_supported_theme_class() ) { ?> |
|
92 | - <p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p> |
|
90 | + <h3><?php _e('You\'re Ready to Rock!', 'lasso'); ?></h3> |
|
91 | + <?php if (lasso_get_supported_theme_class()) { ?> |
|
92 | + <p><?php _e('Your theme is automatically supported. No additional setup is needed.', 'lasso'); ?></p> |
|
93 | 93 | <?php } ?> |
94 | - <p><?php _e( 'Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso' );?></p> |
|
94 | + <p><?php _e('Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso'); ?></p> |
|
95 | 95 | </li> |
96 | 96 | <?php |
97 | 97 | endif; |
@@ -113,16 +113,16 @@ discard block |
||
113 | 113 | |
114 | 114 | <div class="lasso--welcome__top"> |
115 | 115 | |
116 | - <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png';?>"> |
|
117 | - <h1><?php _e( 'Welcome to Editus', 'lasso' );?></h1> |
|
118 | - <p><?php _e( 'Version', 'lasso' );echo '<span> '.LASSO_VERSION.'</span>';?></p> |
|
116 | + <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png'; ?>"> |
|
117 | + <h1><?php _e('Welcome to Editus', 'lasso'); ?></h1> |
|
118 | + <p><?php _e('Version', 'lasso'); echo '<span> '.LASSO_VERSION.'</span>'; ?></p> |
|
119 | 119 | |
120 | - <?php if ( !defined( 'LASSO_AGENCY_MODE' ) ): ?> |
|
120 | + <?php if (!defined('LASSO_AGENCY_MODE')): ?> |
|
121 | 121 | |
122 | 122 | <ul class="lasso--welcome__social"> |
123 | - <li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e( 'Help', 'lasso' );?></a></li> |
|
124 | - <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e( 'Twitter', 'lasso' );?></a></li> |
|
125 | - <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e( 'Facebook', 'lasso' );?></a></li> |
|
123 | + <li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e('Help', 'lasso'); ?></a></li> |
|
124 | + <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e('Twitter', 'lasso'); ?></a></li> |
|
125 | + <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e('Facebook', 'lasso'); ?></a></li> |
|
126 | 126 | </ul> |
127 | 127 | |
128 | 128 | <?php endif; ?> |
@@ -139,62 +139,62 @@ discard block |
||
139 | 139 | */ |
140 | 140 | function lasso_preflight_check() { |
141 | 141 | |
142 | - $notices = array(); |
|
142 | + $notices = array(); |
|
143 | 143 | |
144 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
144 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
145 | 145 | |
146 | - $theme_name = wp_get_theme()->get('Name'); |
|
147 | - $theme_class = lasso_get_supported_theme_class(); |
|
146 | + $theme_name = wp_get_theme()->get('Name'); |
|
147 | + $theme_class = lasso_get_supported_theme_class(); |
|
148 | 148 | |
149 | - $license = get_option( 'lasso_license_key' ); |
|
150 | - $status = get_option( 'lasso_license_status' ); |
|
149 | + $license = get_option('lasso_license_key'); |
|
150 | + $status = get_option('lasso_license_status'); |
|
151 | 151 | |
152 | 152 | |
153 | 153 | // if the required CSS class has not been saved |
154 | - if ( empty( $article_object ) && false == $theme_class ) { |
|
154 | + if (empty($article_object) && false == $theme_class) { |
|
155 | 155 | |
156 | 156 | // we dont automatically support this theme so show them otherwise |
157 | 157 | $notices[] = sprintf('<li class="error"> |
158 | - <h3>'.__( 'Article CSS Class Needed!', 'lasso' ).'</h3> |
|
159 | - <p>'.__( 'Before using Editus,', 'lasso' ).' <a href="%s">'.__( 'enter and save', 'lasso' ).'</a> '.__( 'the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso' ).' <a href="mailto:[email protected]">'.__( 'email us.', 'lasso' ).'</a> '.__( 'with a link to a public URL with the theme and we\'ll find it for you.', 'lasso' ).'</p> |
|
160 | - </li>', admin_url( 'admin.php?page=lasso-editor-settings' ) ); |
|
158 | + <h3>'.__('Article CSS Class Needed!', 'lasso').'</h3> |
|
159 | + <p>'.__('Before using Editus,', 'lasso').' <a href="%s">'.__('enter and save', 'lasso').'</a> '.__('the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso').' <a href="mailto:[email protected]">'.__('email us.', 'lasso').'</a> '.__('with a link to a public URL with the theme and we\'ll find it for you.', 'lasso').'</p> |
|
160 | + </li>', admin_url('admin.php?page=lasso-editor-settings')); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | // WP REST API not active |
164 | - if ( !function_exists( 'json_get_url_prefix' ) && !function_exists( 'rest_url' )) { |
|
164 | + if (!function_exists('json_get_url_prefix') && !function_exists('rest_url')) { |
|
165 | 165 | $notices[] = '<li class="info"><h3>WP REST API not Activated!</h3> |
166 | - <p>'.__( 'Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end.', 'lasso' ).'</p> |
|
166 | + <p>'.__('Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end.', 'lasso').'</p> |
|
167 | 167 | </li>'; |
168 | 168 | } |
169 | 169 | |
170 | 170 | // aesop story engine isnt active |
171 | - if ( !class_exists( 'Aesop_Core' ) ) { |
|
172 | - $notices[] = sprintf( '<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
173 | - <p>'.__( 'Just a heads up that ', 'lasso' ).'<a href="%s" target="_blank |
|
174 | - ">'.__( 'Aesop Story Engine', 'lasso' ).'</a> '.__( 'isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso' ).'</p> |
|
175 | - </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine') ); |
|
171 | + if (!class_exists('Aesop_Core')) { |
|
172 | + $notices[] = sprintf('<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
173 | + <p>'.__('Just a heads up that ', 'lasso').'<a href="%s" target="_blank |
|
174 | + ">'.__('Aesop Story Engine', 'lasso').'</a> '.__('isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso').'</p> |
|
175 | + </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine')); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | // we dont really get along with wp side comments because of the section ids that get applied dynamically. since we save our html, it'll get saved along with the post as HTML |
179 | - if ( class_exists( 'WP_Side_Comments' ) ) { |
|
180 | - $notices[] = '<li class="error"><h3>'.__( 'WP Side Comments Compatibility Warning!', 'lasso' ).'</h3> |
|
181 | - <p>'.__( 'Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso' ).'</p> |
|
179 | + if (class_exists('WP_Side_Comments')) { |
|
180 | + $notices[] = '<li class="error"><h3>'.__('WP Side Comments Compatibility Warning!', 'lasso').'</h3> |
|
181 | + <p>'.__('Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso').'</p> |
|
182 | 182 | </li>'; |
183 | 183 | } |
184 | 184 | |
185 | 185 | // if the license key isnt activated |
186 | - if ( empty( $license ) ) { |
|
187 | - $notices[] = '<li class="info"><h3>'.__( 'License Key Not Activated', 'lasso' ).'</h3> |
|
188 | - <p>'.__( 'Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso' ).'</p> |
|
186 | + if (empty($license)) { |
|
187 | + $notices[] = '<li class="info"><h3>'.__('License Key Not Activated', 'lasso').'</h3> |
|
188 | + <p>'.__('Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso').'</p> |
|
189 | 189 | </li>'; |
190 | 190 | } |
191 | - if ( !empty( $license ) && 'invalid' == $status ) { |
|
192 | - $notices[] = '<li class="error"><h3>'.__( 'License Key Invalid', 'lasso' ).'</h3> |
|
193 | - <p>'.__( 'The license key that you entered is ', 'lasso' ).'<strong>'.__( 'invalid', 'lasso' ).'</strong>'.__( '. It may have been entered incorreclty, or may have expired.', 'lasso' ).'</p> |
|
191 | + if (!empty($license) && 'invalid' == $status) { |
|
192 | + $notices[] = '<li class="error"><h3>'.__('License Key Invalid', 'lasso').'</h3> |
|
193 | + <p>'.__('The license key that you entered is ', 'lasso').'<strong>'.__('invalid', 'lasso').'</strong>'.__('. It may have been entered incorreclty, or may have expired.', 'lasso').'</p> |
|
194 | 194 | </li>'; |
195 | 195 | } |
196 | 196 | |
197 | - return apply_filters( 'lasso_preflight_notices', $notices ); |
|
197 | + return apply_filters('lasso_preflight_notices', $notices); |
|
198 | 198 | |
199 | 199 | } |
200 | 200 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $plugins = array( |
209 | 209 | |
210 | 210 | array( |
211 | - 'name' => __('Aesop Story Engine','lasso'), |
|
211 | + 'name' => __('Aesop Story Engine', 'lasso'), |
|
212 | 212 | 'slug' => 'aesop-story-engine', |
213 | 213 | 'required' => false, |
214 | 214 | ), |
@@ -216,38 +216,38 @@ discard block |
||
216 | 216 | ); |
217 | 217 | |
218 | 218 | $config = array( |
219 | - 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
219 | + 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
220 | 220 | 'menu' => 'lasso-install-plugins', // Menu slug. |
221 | - 'has_notices' => true, // Show admin notices or not. |
|
222 | - 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
223 | - 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
224 | - 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
225 | - 'message' => '', // Message to output right before the plugins table. |
|
221 | + 'has_notices' => true, // Show admin notices or not. |
|
222 | + 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
223 | + 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
224 | + 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
225 | + 'message' => '', // Message to output right before the plugins table. |
|
226 | 226 | 'strings' => array( |
227 | - 'page_title' => __( 'Install Required Plugins', 'lasso' ), |
|
228 | - 'menu_title' => __( 'Install Plugins', 'lasso' ), |
|
229 | - 'installing' => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name. |
|
230 | - 'oops' => __( 'Something went wrong with the plugin API.', 'lasso' ), |
|
231 | - 'notice_can_install_required' => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
232 | - 'notice_can_install_recommended' => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
233 | - 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s). |
|
234 | - 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
235 | - 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
236 | - 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s). |
|
237 | - 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s). |
|
238 | - 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s). |
|
239 | - 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), |
|
240 | - 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), |
|
241 | - 'return' => __( 'Return to Required Plugins Installer', 'lasso' ), |
|
242 | - 'plugin_activated' => __( 'Plugin activated successfully.', 'lasso' ), |
|
243 | - 'complete' => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link. |
|
227 | + 'page_title' => __('Install Required Plugins', 'lasso'), |
|
228 | + 'menu_title' => __('Install Plugins', 'lasso'), |
|
229 | + 'installing' => __('Installing Plugin: %s', 'lasso'), // %s = plugin name. |
|
230 | + 'oops' => __('Something went wrong with the plugin API.', 'lasso'), |
|
231 | + 'notice_can_install_required' => _n_noop('This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.'), // %1$s = plugin name(s). |
|
232 | + 'notice_can_install_recommended' => _n_noop('This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.'), // %1$s = plugin name(s). |
|
233 | + 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.'), // %1$s = plugin name(s). |
|
234 | + 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.'), // %1$s = plugin name(s). |
|
235 | + 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.'), // %1$s = plugin name(s). |
|
236 | + 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.'), // %1$s = plugin name(s). |
|
237 | + 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.'), // %1$s = plugin name(s). |
|
238 | + 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.'), // %1$s = plugin name(s). |
|
239 | + 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins'), |
|
240 | + 'activate_link' => _n_noop('Begin activating plugin', 'Begin activating plugins'), |
|
241 | + 'return' => __('Return to Required Plugins Installer', 'lasso'), |
|
242 | + 'plugin_activated' => __('Plugin activated successfully.', 'lasso'), |
|
243 | + 'complete' => __('All plugins installed and activated successfully. %s', 'lasso'), // %s = dashboard link. |
|
244 | 244 | 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. |
245 | 245 | ) |
246 | 246 | ); |
247 | 247 | |
248 | - $plugins = apply_filters( 'lasso_required_plugins', $plugins ); |
|
248 | + $plugins = apply_filters('lasso_required_plugins', $plugins); |
|
249 | 249 | |
250 | - tgmpa( $plugins, $config ); |
|
250 | + tgmpa($plugins, $config); |
|
251 | 251 | |
252 | 252 | } |
253 | 253 | } |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | |
12 | 12 | ob_start(); |
13 | 13 | |
14 | - if ( $galleries ) { ?> |
|
14 | + if ($galleries) { ?> |
|
15 | 15 | |
16 | - <?php if ( lasso_user_can( 'publish_posts' ) ): ?> |
|
16 | + <?php if (lasso_user_can('publish_posts')): ?> |
|
17 | 17 | <div class="ase-gallery-opts ase-gallery-opts--create-gallery" style="display:inline !important; postion:relative !important;left:12px !important"> |
18 | 18 | <div class="ase-gallery-opts--single lasso-option"> |
19 | - <a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e( 'Create gallery', 'lasso' );?></a> |
|
19 | + <a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e('Create gallery', 'lasso'); ?></a> |
|
20 | 20 | </div> |
21 | 21 | </div> |
22 | 22 | <?php endif; ?> |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | <div class="ase-gallery-opts ase-gallery-opts--edit-gallery" > |
25 | 25 | <div class="ase-gallery-opts--single lasso-option"> |
26 | 26 | |
27 | - <label><?php _e( 'Manage Images', 'lasso' );?> |
|
28 | - <a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e( 'Add Images', 'lasso' );?>"><i class="lasso-icon-pencil"></i></a> |
|
27 | + <label><?php _e('Manage Images', 'lasso'); ?> |
|
28 | + <a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e('Add Images', 'lasso'); ?>"><i class="lasso-icon-pencil"></i></a> |
|
29 | 29 | |
30 | 30 | </label> |
31 | - <small class="lasso-option-desc"><?php _e( 'Rearrange or edit the images in this gallery.', 'lasso' );?></small> |
|
31 | + <small class="lasso-option-desc"><?php _e('Rearrange or edit the images in this gallery.', 'lasso'); ?></small> |
|
32 | 32 | |
33 | 33 | <div id="lasso--gallery__images"><span class="lasso-icon-spinner6"></span></div> |
34 | 34 | |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | |
39 | 39 | <?php } |
40 | 40 | |
41 | - if ( lasso_user_can( 'publish_posts' ) ): ?> |
|
41 | + if (lasso_user_can('publish_posts')): ?> |
|
42 | 42 | |
43 | 43 | <div class="ase-gallery-opts ase-gallery-opts--create-gallery2" style="display:none;"> |
44 | 44 | |
45 | 45 | <div class="ase-gallery-opts--single lasso-option"> |
46 | 46 | |
47 | - <label><?php _e( 'Create a Gallery', 'lasso' );?></label> |
|
47 | + <label><?php _e('Create a Gallery', 'lasso'); ?></label> |
|
48 | 48 | <small class="lasso-option-desc">Gallery Name:</small> |
49 | 49 | <input type="text" id="lasso--gallery__galleryname" value="New Gallery"><br> |
50 | 50 | |
51 | - <small class="lasso-option-desc"><?php _e( 'Select images to create a gallery.', 'lasso' );?></small> |
|
52 | - <a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e( 'Select Images', 'lasso' );?></a> |
|
51 | + <small class="lasso-option-desc"><?php _e('Select images to create a gallery.', 'lasso'); ?></small> |
|
52 | + <a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e('Select Images', 'lasso'); ?></a> |
|
53 | 53 | |
54 | 54 | <div id="ase-gallery-images"></div> |
55 | 55 | |
56 | - <a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr( strtolower( the_title_attribute() ) );?>" id="lasso--gallery__save" href="#"><?php _e( 'Create Gallery', 'lasso' );?></a> |
|
56 | + <a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr(strtolower(the_title_attribute())); ?>" id="lasso--gallery__save" href="#"><?php _e('Create Gallery', 'lasso'); ?></a> |
|
57 | 57 | |
58 | 58 | </div> |
59 | 59 | |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | <!-- Gallery Layout/Type Chooser --> |
65 | 65 | <div class="ase-gallery-opts ase-gallery-opts--type" > |
66 | 66 | <div data-option="gallery-type" class="ase-gallery-opts--single lasso-option"> |
67 | - <label><?php _e( 'Gallery Type', 'lasso' );?></label> |
|
68 | - <small class="lasso-option-desc"><?php _e( 'Select the type of gallery.', 'lasso' );?></small> |
|
67 | + <label><?php _e('Gallery Type', 'lasso'); ?></label> |
|
68 | + <small class="lasso-option-desc"><?php _e('Select the type of gallery.', 'lasso'); ?></small> |
|
69 | 69 | <fieldset> |
70 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e( 'Grid', 'lasso' );?></label> |
|
71 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e( 'Thumbnail', 'lasso' );?></label> |
|
70 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e('Grid', 'lasso'); ?></label> |
|
71 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e('Thumbnail', 'lasso'); ?></label> |
|
72 | 72 | <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="sequence">Sequence</label> |
73 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e( 'Photoset', 'lasso' );?></label> |
|
74 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e( 'Parallax', 'lasso' );?></label> |
|
73 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e('Photoset', 'lasso'); ?></label> |
|
74 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e('Parallax', 'lasso'); ?></label> |
|
75 | 75 | <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="hero">Hero</label> |
76 | 76 | </fieldset> |
77 | 77 | </div> |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | <div class="ase-gallery-opts ase-gallery-opts--grid" style="display:none;"> |
82 | 82 | |
83 | 83 | <div data-option="itemwidth" class="ase-gallery-opts--single lasso-option"> |
84 | - <label for="lasso_grid_gallery_width"><?php _e( 'Grid Item Width', 'lasso' );?></label> |
|
85 | - <small class="lasso-option-desc"><?php _e( 'Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso' );?></small> |
|
84 | + <label for="lasso_grid_gallery_width"><?php _e('Grid Item Width', 'lasso'); ?></label> |
|
85 | + <small class="lasso-option-desc"><?php _e('Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso'); ?></small> |
|
86 | 86 | <input type="text_small" class="lasso-generator-attr" name="lasso_grid_gallery_width" value=""> |
87 | 87 | </div> |
88 | 88 | |
@@ -92,24 +92,24 @@ discard block |
||
92 | 92 | <div class="ase-gallery-opts ase-gallery-opts--thumb" style="display:none;"> |
93 | 93 | |
94 | 94 | <div data-option="transition" class="ase-gallery-opts--single lasso-option"> |
95 | - <label for="lasso_thumb_gallery_transition"><?php _e( 'Gallery Transition', 'lasso' );?></label> |
|
96 | - <small class="lasso-option-desc"><?php _e( 'Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso' );?></small> |
|
95 | + <label for="lasso_thumb_gallery_transition"><?php _e('Gallery Transition', 'lasso'); ?></label> |
|
96 | + <small class="lasso-option-desc"><?php _e('Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso'); ?></small> |
|
97 | 97 | <select name="lasso_thumb_gallery_transition" class="lasso-generator-attr"> |
98 | - <option value="crossfade"><?php _e( 'Fade', 'lasso' );?></option> |
|
99 | - <option value="slide"><?php _e( 'Slide', 'lasso' );?></option> |
|
100 | - <option value="dissolve"><?php _e( 'Dissolve', 'lasso' );?></option> |
|
98 | + <option value="crossfade"><?php _e('Fade', 'lasso'); ?></option> |
|
99 | + <option value="slide"><?php _e('Slide', 'lasso'); ?></option> |
|
100 | + <option value="dissolve"><?php _e('Dissolve', 'lasso'); ?></option> |
|
101 | 101 | </select> |
102 | 102 | </div> |
103 | 103 | |
104 | 104 | <div data-option="speed" class="ase-gallery-opts--single lasso-option"> |
105 | - <label for="lasso_thumb_gallery_transition_speed"><?php _e( 'Gallery Transition Speed', 'lasso' );?></label> |
|
106 | - <small class="lasso-option-desc"><?php _e( 'Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso' );?></small> |
|
105 | + <label for="lasso_thumb_gallery_transition_speed"><?php _e('Gallery Transition Speed', 'lasso'); ?></label> |
|
106 | + <small class="lasso-option-desc"><?php _e('Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso'); ?></small> |
|
107 | 107 | <input type="text" class="lasso-generator-attr" name="lasso_thumb_gallery_transition_speed" value=""> |
108 | 108 | </div> |
109 | 109 | |
110 | 110 | <div data-option="hide-thumbs" class="ase-gallery-opts--single lasso-option"> |
111 | 111 | <input class="lasso-generator-attr" type="checkbox" name="lasso_thumb_gallery_hide_thumbs"> |
112 | - <label for="lasso_thumb_gallery_hide_thumbs"><?php _e( 'Hide Gallery Thumbnails', 'lasso' );?></label> |
|
112 | + <label for="lasso_thumb_gallery_hide_thumbs"><?php _e('Hide Gallery Thumbnails', 'lasso'); ?></label> |
|
113 | 113 | </div> |
114 | 114 | |
115 | 115 | </div> |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | <div class="ase-gallery-opts ase-gallery-opts--photoset" style="display:none;"> |
119 | 119 | |
120 | 120 | <div data-option="pslayout" class="ase-gallery-opts--single lasso-option"> |
121 | - <label for="lasso-photoset-gallery-layout"><?php _e( 'Gallery Layout', 'lasso' );?></label> |
|
122 | - <small class="lasso-option-desc"><?php _e( 'Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso' );?></small> |
|
121 | + <label for="lasso-photoset-gallery-layout"><?php _e('Gallery Layout', 'lasso'); ?></label> |
|
122 | + <small class="lasso-option-desc"><?php _e('Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso'); ?></small> |
|
123 | 123 | <input type="text" class="lasso-generator-attr" name="lasso_photoset_gallery_layout" value=""> |
124 | 124 | </div> |
125 | 125 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | <div class="ase-gallery-opts ase-gallery-opts--hero" style="display:none;"> |
135 | 135 | |
136 | 136 | <div data-option="height" class="ase-gallery-opts--single lasso-option"> |
137 | - <label for="lasso_gallery_height"><?php _e( 'Main Gallery Height', 'lasso' );?></label> |
|
138 | - <small class="lasso-option-desc"><?php _e( 'Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small> |
|
137 | + <label for="lasso_gallery_height"><?php _e('Main Gallery Height', 'lasso'); ?></label> |
|
138 | + <small class="lasso-option-desc"><?php _e('Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small> |
|
139 | 139 | <input type="text_small" class="lasso-generator-attr" name="lasso_gallery_height" value=""> |
140 | 140 | </div> |
141 | 141 | |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | <div class="ase-gallery-opts ase-gallery-opts--global"> |
146 | 146 | |
147 | 147 | <div data-option="width" class="ase-gallery-opts--single lasso-option"> |
148 | - <label for="lasso_gallery_width"><?php _e( 'Main Gallery Width', 'lasso' );?></label> |
|
149 | - <small class="lasso-option-desc"><?php _e( 'Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small> |
|
148 | + <label for="lasso_gallery_width"><?php _e('Main Gallery Width', 'lasso'); ?></label> |
|
149 | + <small class="lasso-option-desc"><?php _e('Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small> |
|
150 | 150 | <input type="text_small" class="lasso-generator-attr" name="lasso_gallery_width" value=""> |
151 | 151 | </div> |
152 | 152 | <div data-option="caption" class="ase-gallery-opts--single lasso-option"> |
153 | - <label for="lasso_gallery_caption"><?php _e( 'Gallery Caption', 'lasso' );?></label> |
|
154 | - <small class="lasso-option-desc"><?php _e( 'Add an optional caption for the gallery.', 'lasso' );?></small> |
|
153 | + <label for="lasso_gallery_caption"><?php _e('Gallery Caption', 'lasso'); ?></label> |
|
154 | + <small class="lasso-option-desc"><?php _e('Add an optional caption for the gallery.', 'lasso'); ?></small> |
|
155 | 155 | <textarea name="lasso_gallery_caption" class="lasso-generator-attr"></textarea> |
156 | 156 | </div> |
157 | 157 |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function update( $data ) { |
|
31 | + public function update($data) { |
|
32 | 32 | |
33 | - $post_id = isset( $data['post_id'] ) ? $data['post_id'] : false; |
|
33 | + $post_id = isset($data['post_id']) ? $data['post_id'] : false; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
@@ -40,19 +40,19 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param array $allowed_fields The fields |
42 | 42 | */ |
43 | - $allowed_fields = apply_filters( 'lasso_meta_fields', array() ); |
|
43 | + $allowed_fields = apply_filters('lasso_meta_fields', array()); |
|
44 | 44 | |
45 | - if ( ! empty( $allowed_fields ) ) { |
|
46 | - foreach( $allowed_fields as $field ) { |
|
47 | - if ( isset( $data[ $field ] ) ) { |
|
45 | + if (!empty($allowed_fields)) { |
|
46 | + foreach ($allowed_fields as $field) { |
|
47 | + if (isset($data[$field])) { |
|
48 | 48 | //this original line changed dash to underscore |
49 | 49 | //update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ] ); |
50 | - update_post_meta( $post_id, $field, $data[ $field ] ); |
|
50 | + update_post_meta($post_id, $field, $data[$field]); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | - do_action( 'editus_after_meta_update', $post_id, $data ); |
|
55 | + do_action('editus_after_meta_update', $post_id, $data); |
|
56 | 56 | |
57 | 57 | |
58 | 58 | return true; |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return array Array of keys to pull from $data per action and their sanitization callback |
68 | 68 | */ |
69 | - public static function params(){ |
|
70 | - $params[ 'process_meta_update' ] = array( |
|
69 | + public static function params() { |
|
70 | + $params['process_meta_update'] = array( |
|
71 | 71 | 'post_id' => 'absint', |
72 | 72 | 'tab_name' => 'trim' |
73 | 73 | ); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @return array Array of additional functions to use to authorize action. |
85 | 85 | */ |
86 | 86 | public static function auth_callbacks() { |
87 | - $params[ 'process_meta_update' ] = array( |
|
87 | + $params['process_meta_update'] = array( |
|
88 | 88 | 'lasso_user_can' |
89 | 89 | ); |
90 | 90 |