@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 224 | 224 | $top_entities = $this->get_top_entities(); |
| 225 | 225 | if ( ! empty( $top_entities ) ) { |
| 226 | - ?> |
|
| 226 | + ?> |
|
| 227 | 227 | <div class="wl-dashboard__block wl-dashboard__block--top-entities"> |
| 228 | 228 | <header> |
| 229 | 229 | <span class="dashicons dashicons-editor-help"></span> |
@@ -233,26 +233,26 @@ discard block |
||
| 233 | 233 | </header> |
| 234 | 234 | <div class="wl-dashboard__block__body"> |
| 235 | 235 | <?php |
| 236 | - $max = $top_entities[0]->total; |
|
| 237 | - $unit = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) ); |
|
| 238 | - $max_value = ceil( (float) $max / $unit ) * $unit; |
|
| 239 | - $chunk_value = $max_value / 4; |
|
| 240 | - ?> |
|
| 236 | + $max = $top_entities[0]->total; |
|
| 237 | + $unit = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) ); |
|
| 238 | + $max_value = ceil( (float) $max / $unit ) * $unit; |
|
| 239 | + $chunk_value = $max_value / 4; |
|
| 240 | + ?> |
|
| 241 | 241 | <div></div> |
| 242 | 242 | <div class="wl-dashboard__block__body__table-header"> |
| 243 | 243 | <?php for ( $i = 0; $i <= $max_value; $i += $chunk_value ) { ?> |
| 244 | 244 | <span><?php echo esc_html( $i ); ?></span><?php } ?> |
| 245 | 245 | </div> |
| 246 | 246 | <?php |
| 247 | - $i = 0; |
|
| 248 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 249 | - foreach ( $this->get_top_entities() as $top_entity ) { |
|
| 250 | - $permalink = get_permalink( $top_entity->ID ); |
|
| 251 | - $post_title = $top_entity->post_title; |
|
| 252 | - $entities_100 = 100 * $top_entity->entities / $max_value; |
|
| 253 | - $posts_100 = 100 * $top_entity->posts / $max_value; |
|
| 254 | - |
|
| 255 | - ?> |
|
| 247 | + $i = 0; |
|
| 248 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 249 | + foreach ( $this->get_top_entities() as $top_entity ) { |
|
| 250 | + $permalink = get_permalink( $top_entity->ID ); |
|
| 251 | + $post_title = $top_entity->post_title; |
|
| 252 | + $entities_100 = 100 * $top_entity->entities / $max_value; |
|
| 253 | + $posts_100 = 100 * $top_entity->posts / $max_value; |
|
| 254 | + |
|
| 255 | + ?> |
|
| 256 | 256 | <div><a href="<?php echo esc_attr( $permalink ); ?>"><?php echo esc_html( $post_title ); ?></a></div> |
| 257 | 257 | <div> |
| 258 | 258 | <div class="wl-dashboard__bar wl-dashboard__bar--posts" |
@@ -263,8 +263,8 @@ discard block |
||
| 263 | 263 | </div> |
| 264 | 264 | </div> |
| 265 | 265 | <?php |
| 266 | - if ( 4 === $i ++ ) { |
|
| 267 | - ?> |
|
| 266 | + if ( 4 === $i ++ ) { |
|
| 267 | + ?> |
|
| 268 | 268 | <input id="wl-dashboard__show-more" type="checkbox"> |
| 269 | 269 | <label for="wl-dashboard__show-more"> |
| 270 | 270 | <span> |
@@ -275,9 +275,9 @@ discard block |
||
| 275 | 275 | </span> |
| 276 | 276 | </label> |
| 277 | 277 | <?php |
| 278 | - } |
|
| 279 | - } |
|
| 280 | - ?> |
|
| 278 | + } |
|
| 279 | + } |
|
| 280 | + ?> |
|
| 281 | 281 | </div> |
| 282 | 282 | </div> |
| 283 | 283 | <?php |
@@ -307,9 +307,9 @@ discard block |
||
| 307 | 307 | <div class="wl-dashboard__block__body"> |
| 308 | 308 | <a href="<?php echo esc_url( $vocabulary_url ); ?>"> |
| 309 | 309 | <?php |
| 310 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 311 | - echo esc_html( $this->entity_service->count() ); |
|
| 312 | - ?> |
|
| 310 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 311 | + echo esc_html( $this->entity_service->count() ); |
|
| 312 | + ?> |
|
| 313 | 313 | </a> |
| 314 | 314 | <a href="<?php echo esc_url( $vocabulary_url ); ?>"><?php echo esc_html( _x( 'Vocabulary', 'Dashboard', 'wordlift' ) ); ?></a> |
| 315 | 315 | </div> |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | white-space: nowrap; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - <?php $blu_dot_url = plugin_dir_url( dirname( __DIR__ ) ) . 'images/blu-dot.gif'; ?> |
|
| 122 | + <?php $blu_dot_url = plugin_dir_url(dirname(__DIR__)).'images/blu-dot.gif'; ?> |
|
| 123 | 123 | #wl-dashboard-v2 .wl-dashboard__block--top-entities .wl-dashboard__block__body > div:nth-child(even) { |
| 124 | 124 | flex: calc(100% - 120px); |
| 125 | 125 | background-color: #ebf6ff; |
| 126 | - background-image: url('<?php echo esc_url( $blu_dot_url ); ?>'), url('<?php echo esc_url( $blu_dot_url ); ?>'), url('<?php echo esc_url( $blu_dot_url ); ?>'); |
|
| 126 | + background-image: url('<?php echo esc_url($blu_dot_url); ?>'), url('<?php echo esc_url($blu_dot_url); ?>'), url('<?php echo esc_url($blu_dot_url); ?>'); |
|
| 127 | 127 | background-position: 25% center, 50%, 75%; |
| 128 | 128 | background-size: 1px 4px; |
| 129 | 129 | background-repeat: repeat-y; |
@@ -222,56 +222,56 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 224 | 224 | $top_entities = $this->get_top_entities(); |
| 225 | -if ( ! empty( $top_entities ) ) { |
|
| 225 | +if ( ! empty($top_entities)) { |
|
| 226 | 226 | ?> |
| 227 | 227 | <div class="wl-dashboard__block wl-dashboard__block--top-entities"> |
| 228 | 228 | <header> |
| 229 | 229 | <span class="dashicons dashicons-editor-help"></span> |
| 230 | - <h3><?php esc_html_e( 'Top entities', 'wordlift' ); ?></h3> |
|
| 231 | - <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html( _x( 'Links with entities', 'Dashboard', 'wordlift' ) ); ?></span> |
|
| 232 | - <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html( _x( 'Post with entities', 'Dashboard', 'wordlift' ) ); ?></span> |
|
| 230 | + <h3><?php esc_html_e('Top entities', 'wordlift'); ?></h3> |
|
| 231 | + <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html(_x('Links with entities', 'Dashboard', 'wordlift')); ?></span> |
|
| 232 | + <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html(_x('Post with entities', 'Dashboard', 'wordlift')); ?></span> |
|
| 233 | 233 | </header> |
| 234 | 234 | <div class="wl-dashboard__block__body"> |
| 235 | 235 | <?php |
| 236 | 236 | $max = $top_entities[0]->total; |
| 237 | - $unit = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) ); |
|
| 238 | - $max_value = ceil( (float) $max / $unit ) * $unit; |
|
| 237 | + $unit = intval('1'.str_repeat('0', strlen($max) - 1)); |
|
| 238 | + $max_value = ceil((float) $max / $unit) * $unit; |
|
| 239 | 239 | $chunk_value = $max_value / 4; |
| 240 | 240 | ?> |
| 241 | 241 | <div></div> |
| 242 | 242 | <div class="wl-dashboard__block__body__table-header"> |
| 243 | - <?php for ( $i = 0; $i <= $max_value; $i += $chunk_value ) { ?> |
|
| 244 | - <span><?php echo esc_html( $i ); ?></span><?php } ?> |
|
| 243 | + <?php for ($i = 0; $i <= $max_value; $i += $chunk_value) { ?> |
|
| 244 | + <span><?php echo esc_html($i); ?></span><?php } ?> |
|
| 245 | 245 | </div> |
| 246 | 246 | <?php |
| 247 | 247 | $i = 0; |
| 248 | 248 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 249 | - foreach ( $this->get_top_entities() as $top_entity ) { |
|
| 250 | - $permalink = get_permalink( $top_entity->ID ); |
|
| 249 | + foreach ($this->get_top_entities() as $top_entity) { |
|
| 250 | + $permalink = get_permalink($top_entity->ID); |
|
| 251 | 251 | $post_title = $top_entity->post_title; |
| 252 | 252 | $entities_100 = 100 * $top_entity->entities / $max_value; |
| 253 | 253 | $posts_100 = 100 * $top_entity->posts / $max_value; |
| 254 | 254 | |
| 255 | 255 | ?> |
| 256 | - <div><a href="<?php echo esc_attr( $permalink ); ?>"><?php echo esc_html( $post_title ); ?></a></div> |
|
| 256 | + <div><a href="<?php echo esc_attr($permalink); ?>"><?php echo esc_html($post_title); ?></a></div> |
|
| 257 | 257 | <div> |
| 258 | 258 | <div class="wl-dashboard__bar wl-dashboard__bar--posts" |
| 259 | - style="width: <?php echo esc_attr( $posts_100 ); ?>%;"> |
|
| 259 | + style="width: <?php echo esc_attr($posts_100); ?>%;"> |
|
| 260 | 260 | </div> |
| 261 | 261 | <div class="wl-dashboard__bar wl-dashboard__bar--entities" |
| 262 | - style="width: <?php echo esc_attr( $entities_100 ); ?>%;"> |
|
| 262 | + style="width: <?php echo esc_attr($entities_100); ?>%;"> |
|
| 263 | 263 | </div> |
| 264 | 264 | </div> |
| 265 | 265 | <?php |
| 266 | - if ( 4 === $i ++ ) { |
|
| 266 | + if (4 === $i++) { |
|
| 267 | 267 | ?> |
| 268 | 268 | <input id="wl-dashboard__show-more" type="checkbox"> |
| 269 | 269 | <label for="wl-dashboard__show-more"> |
| 270 | 270 | <span> |
| 271 | - <?php echo esc_html( __( 'Show more', 'wordlift' ) ); ?> |
|
| 271 | + <?php echo esc_html(__('Show more', 'wordlift')); ?> |
|
| 272 | 272 | </span> |
| 273 | 273 | <span> |
| 274 | - <?php echo esc_html( __( 'Hide', 'wordlift' ) ); ?> |
|
| 274 | + <?php echo esc_html(__('Hide', 'wordlift')); ?> |
|
| 275 | 275 | </span> |
| 276 | 276 | </label> |
| 277 | 277 | <?php |
@@ -283,46 +283,46 @@ discard block |
||
| 283 | 283 | <?php |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | -$not_enriched_url = admin_url( 'edit.php?post_type=post&wl_enriched=no' ); |
|
| 286 | +$not_enriched_url = admin_url('edit.php?post_type=post&wl_enriched=no'); |
|
| 287 | 287 | $dashboard_service = Wordlift_Dashboard_Service::get_instance(); |
| 288 | 288 | ?> |
| 289 | 289 | <div class="wl-dashboard__block wl-dashboard__block--enriched-posts"> |
| 290 | 290 | <header> |
| 291 | 291 | <span class="dashicons dashicons-editor-help"></span> |
| 292 | - <h3><?php echo esc_html__( 'Enriched posts', 'wordlift' ); ?></h3> |
|
| 292 | + <h3><?php echo esc_html__('Enriched posts', 'wordlift'); ?></h3> |
|
| 293 | 293 | </header> |
| 294 | 294 | <div class="wl-dashboard__block__body"> |
| 295 | - <a href="<?php echo esc_url( $not_enriched_url ); ?>"><?php echo esc_html( $dashboard_service->count_annotated_posts() ); ?></a> |
|
| 296 | - / <?php echo esc_html( $dashboard_service->count_posts() ); ?> |
|
| 297 | - <a href="<?php echo esc_url( $not_enriched_url ); ?>"><?php echo esc_html( _x( 'Enrich', 'Dashboard', 'wordlift' ) ); ?></a> |
|
| 295 | + <a href="<?php echo esc_url($not_enriched_url); ?>"><?php echo esc_html($dashboard_service->count_annotated_posts()); ?></a> |
|
| 296 | + / <?php echo esc_html($dashboard_service->count_posts()); ?> |
|
| 297 | + <a href="<?php echo esc_url($not_enriched_url); ?>"><?php echo esc_html(_x('Enrich', 'Dashboard', 'wordlift')); ?></a> |
|
| 298 | 298 | </div> |
| 299 | 299 | </div> |
| 300 | 300 | |
| 301 | -<?php $vocabulary_url = admin_url( 'edit.php?post_type=entity' ); ?> |
|
| 301 | +<?php $vocabulary_url = admin_url('edit.php?post_type=entity'); ?> |
|
| 302 | 302 | <div class="wl-dashboard__block wl-dashboard__block--created-entities"> |
| 303 | 303 | <header> |
| 304 | 304 | <span class="dashicons dashicons-editor-help"></span> |
| 305 | - <h3><?php esc_html_e( 'Created entities', 'wordlift' ); ?></h3> |
|
| 305 | + <h3><?php esc_html_e('Created entities', 'wordlift'); ?></h3> |
|
| 306 | 306 | </header> |
| 307 | 307 | <div class="wl-dashboard__block__body"> |
| 308 | - <a href="<?php echo esc_url( $vocabulary_url ); ?>"> |
|
| 308 | + <a href="<?php echo esc_url($vocabulary_url); ?>"> |
|
| 309 | 309 | <?php |
| 310 | 310 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 311 | - echo esc_html( $this->entity_service->count() ); |
|
| 311 | + echo esc_html($this->entity_service->count()); |
|
| 312 | 312 | ?> |
| 313 | 313 | </a> |
| 314 | - <a href="<?php echo esc_url( $vocabulary_url ); ?>"><?php echo esc_html( _x( 'Vocabulary', 'Dashboard', 'wordlift' ) ); ?></a> |
|
| 314 | + <a href="<?php echo esc_url($vocabulary_url); ?>"><?php echo esc_html(_x('Vocabulary', 'Dashboard', 'wordlift')); ?></a> |
|
| 315 | 315 | </div> |
| 316 | 316 | </div> |
| 317 | 317 | |
| 318 | 318 | <div class="wl-dashboard__block wl-dashboard__block--average-entity-rating"> |
| 319 | 319 | <header> |
| 320 | 320 | <span class="dashicons dashicons-editor-help"></span> |
| 321 | - <h3><?php echo esc_html__( 'Average entity rating', 'wordlift' ); ?></h3> |
|
| 321 | + <h3><?php echo esc_html__('Average entity rating', 'wordlift'); ?></h3> |
|
| 322 | 322 | </header> |
| 323 | 323 | <div class="wl-dashboard__block__body"> |
| 324 | - <?php echo esc_html( $dashboard_service->average_entities_rating() ); ?> |
|
| 325 | - <?php echo esc_html( _x( 'Boost', 'Dashboard', 'wordlift' ) ); ?> |
|
| 324 | + <?php echo esc_html($dashboard_service->average_entities_rating()); ?> |
|
| 325 | + <?php echo esc_html(_x('Boost', 'Dashboard', 'wordlift')); ?> |
|
| 326 | 326 | </div> |
| 327 | 327 | </div> |
| 328 | 328 | <?php |
@@ -333,4 +333,4 @@ discard block |
||
| 333 | 333 | * @author Naveen Muthusamy <[email protected]> |
| 334 | 334 | * Action name : wl_admin_dashboard_widgets |
| 335 | 335 | */ |
| 336 | -do_action( 'wl_admin_dashboard_widgets' ); |
|
| 336 | +do_action('wl_admin_dashboard_widgets'); |
|
@@ -11,10 +11,10 @@ discard block |
||
| 11 | 11 | <?php settings_errors(); ?> |
| 12 | 12 | <form action="options.php" method="post"> |
| 13 | 13 | <?php |
| 14 | - settings_fields( 'wl_analytics_settings' ); |
|
| 15 | - do_settings_sections( 'wl_analytics_settings' ); |
|
| 16 | - submit_button(); |
|
| 17 | - ?> |
|
| 14 | + settings_fields( 'wl_analytics_settings' ); |
|
| 15 | + do_settings_sections( 'wl_analytics_settings' ); |
|
| 16 | + submit_button(); |
|
| 17 | + ?> |
|
| 18 | 18 | </form> |
| 19 | 19 | <div class="info"> |
| 20 | 20 | <b><?php esc_html_e( 'For Google Tag Manager there is additional setup steps needed in the GTM interface. These are the general instructions:', 'wordlift' ); ?></b> |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | <li><?php esc_html_e( 'You should already have a configuration variable setup to pass data along to your provider. This is assumed to be Google Analytics and a google analytics configuration object. If you don\'t have this setup then set it up now.', 'wordlift' ); ?></li> |
| 23 | 23 | <li> |
| 24 | 24 | <?php |
| 25 | - printf( |
|
| 26 | - /* translators: 1: Variables, 2: Data Layer Variable. */ |
|
| 27 | - esc_html__( 'Visit the GTM dashboard and head to the %1$s menu. Add a new user-defined variable of type %2$s for each of the following items:', 'wordlift' ), |
|
| 28 | - '<b>Variables</b>', |
|
| 29 | - '<i>Data Layer Variable</i>' |
|
| 30 | - ); |
|
| 31 | - ?> |
|
| 25 | + printf( |
|
| 26 | + /* translators: 1: Variables, 2: Data Layer Variable. */ |
|
| 27 | + esc_html__( 'Visit the GTM dashboard and head to the %1$s menu. Add a new user-defined variable of type %2$s for each of the following items:', 'wordlift' ), |
|
| 28 | + '<b>Variables</b>', |
|
| 29 | + '<i>Data Layer Variable</i>' |
|
| 30 | + ); |
|
| 31 | + ?> |
|
| 32 | 32 | <ol> |
| 33 | 33 | <li><i>event</i></li> |
| 34 | 34 | <li><i>wl_event_action</i></li> |
@@ -44,56 +44,56 @@ discard block |
||
| 44 | 44 | </li> |
| 45 | 45 | <li> |
| 46 | 46 | <?php |
| 47 | - printf( |
|
| 48 | - /* translators: 1: Google Analytics Settings. */ |
|
| 49 | - esc_html__( 'Create another variable to pass along the 2 custom dimensions with the type %1$s. For each of the 2 items set the following:', 'wordlift' ), |
|
| 50 | - '<i>Google Analytics Settings</i>' |
|
| 51 | - ); |
|
| 52 | - ?> |
|
| 47 | + printf( |
|
| 48 | + /* translators: 1: Google Analytics Settings. */ |
|
| 49 | + esc_html__( 'Create another variable to pass along the 2 custom dimensions with the type %1$s. For each of the 2 items set the following:', 'wordlift' ), |
|
| 50 | + '<i>Google Analytics Settings</i>' |
|
| 51 | + ); |
|
| 52 | + ?> |
|
| 53 | 53 | <ol> |
| 54 | 54 | <li><?php esc_html_e( 'Set the index to the index of the custom event you want to push this into at Google Analytics, this will usually be a number between 1 and 9.', 'wordlift' ); ?></li> |
| 55 | 55 | <li> |
| 56 | 56 | <?php |
| 57 | - printf( |
|
| 58 | - /* translators: 1: wl_index_uri, 2: wl_index_type. */ |
|
| 59 | - esc_html__( 'Set the values of each one to the %1$s and the %2$s respectively.', 'wordlift' ), |
|
| 60 | - '<i>wl_index_uri</i> - <i>wl_event_uri</i>', |
|
| 61 | - '<i>wl_index_type</i> - <i>wl_event_type</i>' |
|
| 62 | - ); |
|
| 63 | - ?> |
|
| 57 | + printf( |
|
| 58 | + /* translators: 1: wl_index_uri, 2: wl_index_type. */ |
|
| 59 | + esc_html__( 'Set the values of each one to the %1$s and the %2$s respectively.', 'wordlift' ), |
|
| 60 | + '<i>wl_index_uri</i> - <i>wl_event_uri</i>', |
|
| 61 | + '<i>wl_index_type</i> - <i>wl_event_type</i>' |
|
| 62 | + ); |
|
| 63 | + ?> |
|
| 64 | 64 | </li> |
| 65 | 65 | </ol> |
| 66 | 66 | </li> |
| 67 | 67 | <li> |
| 68 | 68 | <?php |
| 69 | - printf( |
|
| 70 | - /* translators: 1: Triggers, 2: Custom Events. */ |
|
| 71 | - esc_html__( 'Go to the %1$s menu and create a new trigger of the type: %2$s.', 'wordlift' ), |
|
| 72 | - '<b>Triggers</b>', |
|
| 73 | - '<i>Custom Event</i>' |
|
| 74 | - ); |
|
| 75 | - ?> |
|
| 69 | + printf( |
|
| 70 | + /* translators: 1: Triggers, 2: Custom Events. */ |
|
| 71 | + esc_html__( 'Go to the %1$s menu and create a new trigger of the type: %2$s.', 'wordlift' ), |
|
| 72 | + '<b>Triggers</b>', |
|
| 73 | + '<i>Custom Event</i>' |
|
| 74 | + ); |
|
| 75 | + ?> |
|
| 76 | 76 | <ol> |
| 77 | 77 | <li> |
| 78 | 78 | |
| 79 | 79 | <?php |
| 80 | - printf( |
|
| 81 | - /* translators: 1: Event name, 2: Mentions. */ |
|
| 82 | - esc_html__( 'In the %1$s field input %2$s.', 'wordlift' ), |
|
| 83 | - '<i>Event name</i>', |
|
| 84 | - '<i>Mentions</i>' |
|
| 85 | - ); |
|
| 86 | - ?> |
|
| 80 | + printf( |
|
| 81 | + /* translators: 1: Event name, 2: Mentions. */ |
|
| 82 | + esc_html__( 'In the %1$s field input %2$s.', 'wordlift' ), |
|
| 83 | + '<i>Event name</i>', |
|
| 84 | + '<i>Mentions</i>' |
|
| 85 | + ); |
|
| 86 | + ?> |
|
| 87 | 87 | </li> |
| 88 | 88 | <li> |
| 89 | 89 | |
| 90 | 90 | <?php |
| 91 | - printf( |
|
| 92 | - /* translators: 1: Some Custom Events. */ |
|
| 93 | - esc_html__( 'Set this to fire on %1$s and in the filter set:', 'wordlift' ), |
|
| 94 | - '<i>Some Custom Events</i>' |
|
| 95 | - ); |
|
| 96 | - ?> |
|
| 91 | + printf( |
|
| 92 | + /* translators: 1: Some Custom Events. */ |
|
| 93 | + esc_html__( 'Set this to fire on %1$s and in the filter set:', 'wordlift' ), |
|
| 94 | + '<i>Some Custom Events</i>' |
|
| 95 | + ); |
|
| 96 | + ?> |
|
| 97 | 97 | <ol> |
| 98 | 98 | <li><i>event_action</i> - <i>equals</i> - <i>Mentions</i>.</li> |
| 99 | 99 | </ol> |
@@ -102,86 +102,86 @@ discard block |
||
| 102 | 102 | </li> |
| 103 | 103 | <li> |
| 104 | 104 | <?php |
| 105 | - printf( |
|
| 106 | - /* translators: 1: Tags. */ |
|
| 107 | - esc_html__( 'Go to the %1$s menu and create a new tag.', 'wordlift' ), |
|
| 108 | - '<b>Tags</b>' |
|
| 109 | - ); |
|
| 110 | - ?> |
|
| 105 | + printf( |
|
| 106 | + /* translators: 1: Tags. */ |
|
| 107 | + esc_html__( 'Go to the %1$s menu and create a new tag.', 'wordlift' ), |
|
| 108 | + '<b>Tags</b>' |
|
| 109 | + ); |
|
| 110 | + ?> |
|
| 111 | 111 | <ol> |
| 112 | 112 | <li> |
| 113 | 113 | |
| 114 | 114 | <?php |
| 115 | - printf( |
|
| 116 | - /* translators: 1: Google Analytics. */ |
|
| 117 | - esc_html__( 'In the tag configuration section choose %1$s. Assuming you have used variable names that match those mentioned enter:', 'wordlift' ), |
|
| 118 | - '<i>Google Analytics - Universal Analytics</i>' |
|
| 119 | - ); |
|
| 120 | - ?> |
|
| 115 | + printf( |
|
| 116 | + /* translators: 1: Google Analytics. */ |
|
| 117 | + esc_html__( 'In the tag configuration section choose %1$s. Assuming you have used variable names that match those mentioned enter:', 'wordlift' ), |
|
| 118 | + '<i>Google Analytics - Universal Analytics</i>' |
|
| 119 | + ); |
|
| 120 | + ?> |
|
| 121 | 121 | <ol> |
| 122 | 122 | <li> |
| 123 | 123 | <?php |
| 124 | - printf( |
|
| 125 | - /* translators: 1: Track Type, 2: Event. */ |
|
| 126 | - esc_html__( 'Set the %1$s to %2$s.', 'wordlift' ), |
|
| 127 | - 'Track Type', |
|
| 128 | - '<i>Event</i>' |
|
| 129 | - ); |
|
| 130 | - ?> |
|
| 124 | + printf( |
|
| 125 | + /* translators: 1: Track Type, 2: Event. */ |
|
| 126 | + esc_html__( 'Set the %1$s to %2$s.', 'wordlift' ), |
|
| 127 | + 'Track Type', |
|
| 128 | + '<i>Event</i>' |
|
| 129 | + ); |
|
| 130 | + ?> |
|
| 131 | 131 | </li> |
| 132 | 132 | <li> |
| 133 | 133 | <?php |
| 134 | - printf( |
|
| 135 | - /* translators: 1: wl_event_category. */ |
|
| 136 | - esc_html__( 'Set Category to %1$s.', 'wordlift' ), |
|
| 137 | - '<i>{{wl_event_category}}</i>' |
|
| 138 | - ); |
|
| 139 | - ?> |
|
| 134 | + printf( |
|
| 135 | + /* translators: 1: wl_event_category. */ |
|
| 136 | + esc_html__( 'Set Category to %1$s.', 'wordlift' ), |
|
| 137 | + '<i>{{wl_event_category}}</i>' |
|
| 138 | + ); |
|
| 139 | + ?> |
|
| 140 | 140 | </li> |
| 141 | 141 | <li> |
| 142 | 142 | <?php |
| 143 | - printf( |
|
| 144 | - /* translators: 1: wl_event_action. */ |
|
| 145 | - esc_html__( 'Set Action to %1$s.', 'wordlift' ), |
|
| 146 | - '<i>{{wl_event_action}}</i>' |
|
| 147 | - ); |
|
| 148 | - ?> |
|
| 143 | + printf( |
|
| 144 | + /* translators: 1: wl_event_action. */ |
|
| 145 | + esc_html__( 'Set Action to %1$s.', 'wordlift' ), |
|
| 146 | + '<i>{{wl_event_action}}</i>' |
|
| 147 | + ); |
|
| 148 | + ?> |
|
| 149 | 149 | </li> |
| 150 | 150 | <li> |
| 151 | 151 | <?php |
| 152 | - printf( |
|
| 153 | - /* translators: 1: wl_event_label. */ |
|
| 154 | - esc_html__( 'Set Label to %1$s.', 'wordlift' ), |
|
| 155 | - '<i>{{wl_event_label}}</i>' |
|
| 156 | - ); |
|
| 157 | - ?> |
|
| 152 | + printf( |
|
| 153 | + /* translators: 1: wl_event_label. */ |
|
| 154 | + esc_html__( 'Set Label to %1$s.', 'wordlift' ), |
|
| 155 | + '<i>{{wl_event_label}}</i>' |
|
| 156 | + ); |
|
| 157 | + ?> |
|
| 158 | 158 | </li> |
| 159 | 159 | <li> |
| 160 | 160 | <?php |
| 161 | - printf( |
|
| 162 | - /* translators: 1: wl_event_value. */ |
|
| 163 | - esc_html__( 'Set Value to %1$s.', 'wordlift' ), |
|
| 164 | - '<i>{{wl_event_value}}</i>' |
|
| 165 | - ); |
|
| 166 | - ?> |
|
| 161 | + printf( |
|
| 162 | + /* translators: 1: wl_event_value. */ |
|
| 163 | + esc_html__( 'Set Value to %1$s.', 'wordlift' ), |
|
| 164 | + '<i>{{wl_event_value}}</i>' |
|
| 165 | + ); |
|
| 166 | + ?> |
|
| 167 | 167 | </li> |
| 168 | 168 | <li> |
| 169 | 169 | <?php |
| 170 | - printf( |
|
| 171 | - /* translators: 1: True. */ |
|
| 172 | - esc_html__( 'Set Non-Interaction Hit to %1$s.', 'wordlift' ), |
|
| 173 | - '<i>True</i>' |
|
| 174 | - ); |
|
| 175 | - ?> |
|
| 170 | + printf( |
|
| 171 | + /* translators: 1: True. */ |
|
| 172 | + esc_html__( 'Set Non-Interaction Hit to %1$s.', 'wordlift' ), |
|
| 173 | + '<i>True</i>' |
|
| 174 | + ); |
|
| 175 | + ?> |
|
| 176 | 176 | </li> |
| 177 | 177 | <li> |
| 178 | 178 | <?php |
| 179 | - printf( |
|
| 180 | - /* translators: 1: Google Analytics Settings. */ |
|
| 181 | - esc_html__( 'Set the %1$s dropdown to the settings object for the Google Analytics tracking.', 'wordlift' ), |
|
| 182 | - '<i>Google Analytics Settings</i>' |
|
| 183 | - ); |
|
| 184 | - ?> |
|
| 179 | + printf( |
|
| 180 | + /* translators: 1: Google Analytics Settings. */ |
|
| 181 | + esc_html__( 'Set the %1$s dropdown to the settings object for the Google Analytics tracking.', 'wordlift' ), |
|
| 182 | + '<i>Google Analytics Settings</i>' |
|
| 183 | + ); |
|
| 184 | + ?> |
|
| 185 | 185 | </li> |
| 186 | 186 | </ol> |
| 187 | 187 | </li> |
@@ -11,20 +11,20 @@ discard block |
||
| 11 | 11 | <?php settings_errors(); ?> |
| 12 | 12 | <form action="options.php" method="post"> |
| 13 | 13 | <?php |
| 14 | - settings_fields( 'wl_analytics_settings' ); |
|
| 15 | - do_settings_sections( 'wl_analytics_settings' ); |
|
| 14 | + settings_fields('wl_analytics_settings'); |
|
| 15 | + do_settings_sections('wl_analytics_settings'); |
|
| 16 | 16 | submit_button(); |
| 17 | 17 | ?> |
| 18 | 18 | </form> |
| 19 | 19 | <div class="info"> |
| 20 | - <b><?php esc_html_e( 'For Google Tag Manager there is additional setup steps needed in the GTM interface. These are the general instructions:', 'wordlift' ); ?></b> |
|
| 20 | + <b><?php esc_html_e('For Google Tag Manager there is additional setup steps needed in the GTM interface. These are the general instructions:', 'wordlift'); ?></b> |
|
| 21 | 21 | <ol> |
| 22 | - <li><?php esc_html_e( 'You should already have a configuration variable setup to pass data along to your provider. This is assumed to be Google Analytics and a google analytics configuration object. If you don\'t have this setup then set it up now.', 'wordlift' ); ?></li> |
|
| 22 | + <li><?php esc_html_e('You should already have a configuration variable setup to pass data along to your provider. This is assumed to be Google Analytics and a google analytics configuration object. If you don\'t have this setup then set it up now.', 'wordlift'); ?></li> |
|
| 23 | 23 | <li> |
| 24 | 24 | <?php |
| 25 | 25 | printf( |
| 26 | 26 | /* translators: 1: Variables, 2: Data Layer Variable. */ |
| 27 | - esc_html__( 'Visit the GTM dashboard and head to the %1$s menu. Add a new user-defined variable of type %2$s for each of the following items:', 'wordlift' ), |
|
| 27 | + esc_html__('Visit the GTM dashboard and head to the %1$s menu. Add a new user-defined variable of type %2$s for each of the following items:', 'wordlift'), |
|
| 28 | 28 | '<b>Variables</b>', |
| 29 | 29 | '<i>Data Layer Variable</i>' |
| 30 | 30 | ); |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | <li><i>wl_event_category</i></li> |
| 36 | 36 | <li><i>wl_event_label</i></li> |
| 37 | 37 | <li><i>wl_event_value</i></li> |
| 38 | - <li><i>wl_event_uri</i> <?php esc_html_e( '(which is the first custom dimension number the plugin offers)', 'wordlift' ); ?></li> |
|
| 39 | - <li><i>wl_index_uri</i> <?php esc_html_e( '(this is the index number sent to use as the custom dimention for uri)', 'wordlift' ); ?></li> |
|
| 40 | - <li><i>wl_event_type</i> <?php esc_html_e( '(which is the second custom dimension number the plugin offers)', 'wordlift' ); ?></li> |
|
| 41 | - <li><i>wl_index_type</i> <?php esc_html_e( '(this is the index number sent to use as the custom dimention for type)', 'wordlift' ); ?></li> |
|
| 38 | + <li><i>wl_event_uri</i> <?php esc_html_e('(which is the first custom dimension number the plugin offers)', 'wordlift'); ?></li> |
|
| 39 | + <li><i>wl_index_uri</i> <?php esc_html_e('(this is the index number sent to use as the custom dimention for uri)', 'wordlift'); ?></li> |
|
| 40 | + <li><i>wl_event_type</i> <?php esc_html_e('(which is the second custom dimension number the plugin offers)', 'wordlift'); ?></li> |
|
| 41 | + <li><i>wl_index_type</i> <?php esc_html_e('(this is the index number sent to use as the custom dimention for type)', 'wordlift'); ?></li> |
|
| 42 | 42 | |
| 43 | 43 | </ol> |
| 44 | 44 | </li> |
@@ -46,17 +46,17 @@ discard block |
||
| 46 | 46 | <?php |
| 47 | 47 | printf( |
| 48 | 48 | /* translators: 1: Google Analytics Settings. */ |
| 49 | - esc_html__( 'Create another variable to pass along the 2 custom dimensions with the type %1$s. For each of the 2 items set the following:', 'wordlift' ), |
|
| 49 | + esc_html__('Create another variable to pass along the 2 custom dimensions with the type %1$s. For each of the 2 items set the following:', 'wordlift'), |
|
| 50 | 50 | '<i>Google Analytics Settings</i>' |
| 51 | 51 | ); |
| 52 | 52 | ?> |
| 53 | 53 | <ol> |
| 54 | - <li><?php esc_html_e( 'Set the index to the index of the custom event you want to push this into at Google Analytics, this will usually be a number between 1 and 9.', 'wordlift' ); ?></li> |
|
| 54 | + <li><?php esc_html_e('Set the index to the index of the custom event you want to push this into at Google Analytics, this will usually be a number between 1 and 9.', 'wordlift'); ?></li> |
|
| 55 | 55 | <li> |
| 56 | 56 | <?php |
| 57 | 57 | printf( |
| 58 | 58 | /* translators: 1: wl_index_uri, 2: wl_index_type. */ |
| 59 | - esc_html__( 'Set the values of each one to the %1$s and the %2$s respectively.', 'wordlift' ), |
|
| 59 | + esc_html__('Set the values of each one to the %1$s and the %2$s respectively.', 'wordlift'), |
|
| 60 | 60 | '<i>wl_index_uri</i> - <i>wl_event_uri</i>', |
| 61 | 61 | '<i>wl_index_type</i> - <i>wl_event_type</i>' |
| 62 | 62 | ); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | <?php |
| 69 | 69 | printf( |
| 70 | 70 | /* translators: 1: Triggers, 2: Custom Events. */ |
| 71 | - esc_html__( 'Go to the %1$s menu and create a new trigger of the type: %2$s.', 'wordlift' ), |
|
| 71 | + esc_html__('Go to the %1$s menu and create a new trigger of the type: %2$s.', 'wordlift'), |
|
| 72 | 72 | '<b>Triggers</b>', |
| 73 | 73 | '<i>Custom Event</i>' |
| 74 | 74 | ); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | <?php |
| 80 | 80 | printf( |
| 81 | 81 | /* translators: 1: Event name, 2: Mentions. */ |
| 82 | - esc_html__( 'In the %1$s field input %2$s.', 'wordlift' ), |
|
| 82 | + esc_html__('In the %1$s field input %2$s.', 'wordlift'), |
|
| 83 | 83 | '<i>Event name</i>', |
| 84 | 84 | '<i>Mentions</i>' |
| 85 | 85 | ); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | <?php |
| 91 | 91 | printf( |
| 92 | 92 | /* translators: 1: Some Custom Events. */ |
| 93 | - esc_html__( 'Set this to fire on %1$s and in the filter set:', 'wordlift' ), |
|
| 93 | + esc_html__('Set this to fire on %1$s and in the filter set:', 'wordlift'), |
|
| 94 | 94 | '<i>Some Custom Events</i>' |
| 95 | 95 | ); |
| 96 | 96 | ?> |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | <?php |
| 105 | 105 | printf( |
| 106 | 106 | /* translators: 1: Tags. */ |
| 107 | - esc_html__( 'Go to the %1$s menu and create a new tag.', 'wordlift' ), |
|
| 107 | + esc_html__('Go to the %1$s menu and create a new tag.', 'wordlift'), |
|
| 108 | 108 | '<b>Tags</b>' |
| 109 | 109 | ); |
| 110 | 110 | ?> |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | <?php |
| 115 | 115 | printf( |
| 116 | 116 | /* translators: 1: Google Analytics. */ |
| 117 | - esc_html__( 'In the tag configuration section choose %1$s. Assuming you have used variable names that match those mentioned enter:', 'wordlift' ), |
|
| 117 | + esc_html__('In the tag configuration section choose %1$s. Assuming you have used variable names that match those mentioned enter:', 'wordlift'), |
|
| 118 | 118 | '<i>Google Analytics - Universal Analytics</i>' |
| 119 | 119 | ); |
| 120 | 120 | ?> |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | <?php |
| 124 | 124 | printf( |
| 125 | 125 | /* translators: 1: Track Type, 2: Event. */ |
| 126 | - esc_html__( 'Set the %1$s to %2$s.', 'wordlift' ), |
|
| 126 | + esc_html__('Set the %1$s to %2$s.', 'wordlift'), |
|
| 127 | 127 | 'Track Type', |
| 128 | 128 | '<i>Event</i>' |
| 129 | 129 | ); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | <?php |
| 134 | 134 | printf( |
| 135 | 135 | /* translators: 1: wl_event_category. */ |
| 136 | - esc_html__( 'Set Category to %1$s.', 'wordlift' ), |
|
| 136 | + esc_html__('Set Category to %1$s.', 'wordlift'), |
|
| 137 | 137 | '<i>{{wl_event_category}}</i>' |
| 138 | 138 | ); |
| 139 | 139 | ?> |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | <?php |
| 143 | 143 | printf( |
| 144 | 144 | /* translators: 1: wl_event_action. */ |
| 145 | - esc_html__( 'Set Action to %1$s.', 'wordlift' ), |
|
| 145 | + esc_html__('Set Action to %1$s.', 'wordlift'), |
|
| 146 | 146 | '<i>{{wl_event_action}}</i>' |
| 147 | 147 | ); |
| 148 | 148 | ?> |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | <?php |
| 152 | 152 | printf( |
| 153 | 153 | /* translators: 1: wl_event_label. */ |
| 154 | - esc_html__( 'Set Label to %1$s.', 'wordlift' ), |
|
| 154 | + esc_html__('Set Label to %1$s.', 'wordlift'), |
|
| 155 | 155 | '<i>{{wl_event_label}}</i>' |
| 156 | 156 | ); |
| 157 | 157 | ?> |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | <?php |
| 161 | 161 | printf( |
| 162 | 162 | /* translators: 1: wl_event_value. */ |
| 163 | - esc_html__( 'Set Value to %1$s.', 'wordlift' ), |
|
| 163 | + esc_html__('Set Value to %1$s.', 'wordlift'), |
|
| 164 | 164 | '<i>{{wl_event_value}}</i>' |
| 165 | 165 | ); |
| 166 | 166 | ?> |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | <?php |
| 170 | 170 | printf( |
| 171 | 171 | /* translators: 1: True. */ |
| 172 | - esc_html__( 'Set Non-Interaction Hit to %1$s.', 'wordlift' ), |
|
| 172 | + esc_html__('Set Non-Interaction Hit to %1$s.', 'wordlift'), |
|
| 173 | 173 | '<i>True</i>' |
| 174 | 174 | ); |
| 175 | 175 | ?> |
@@ -178,14 +178,14 @@ discard block |
||
| 178 | 178 | <?php |
| 179 | 179 | printf( |
| 180 | 180 | /* translators: 1: Google Analytics Settings. */ |
| 181 | - esc_html__( 'Set the %1$s dropdown to the settings object for the Google Analytics tracking.', 'wordlift' ), |
|
| 181 | + esc_html__('Set the %1$s dropdown to the settings object for the Google Analytics tracking.', 'wordlift'), |
|
| 182 | 182 | '<i>Google Analytics Settings</i>' |
| 183 | 183 | ); |
| 184 | 184 | ?> |
| 185 | 185 | </li> |
| 186 | 186 | </ol> |
| 187 | 187 | </li> |
| 188 | - <li><?php esc_html_e( 'In the triggering tag select the firing trigger you created previously.', 'wordlift' ); ?></li> |
|
| 188 | + <li><?php esc_html_e('In the triggering tag select the firing trigger you created previously.', 'wordlift'); ?></li> |
|
| 189 | 189 | </ol> |
| 190 | 190 | </li> |
| 191 | 191 | </ol> |
@@ -1,63 +1,63 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | $too_complicate_reason_label = sprintf( |
| 3 | - '<a target="_blank" href="%s">%s</a>', |
|
| 4 | - /* translators: the link https://wordlift.io/contact-us/ should be changed to language version of the page */ |
|
| 5 | - esc_attr__( 'https://wordlift.io/contact-us/', 'wordlift' ), |
|
| 6 | - esc_html__( 'Contact Us', 'wordlift' ) |
|
| 3 | + '<a target="_blank" href="%s">%s</a>', |
|
| 4 | + /* translators: the link https://wordlift.io/contact-us/ should be changed to language version of the page */ |
|
| 5 | + esc_attr__( 'https://wordlift.io/contact-us/', 'wordlift' ), |
|
| 6 | + esc_html__( 'Contact Us', 'wordlift' ) |
|
| 7 | 7 | ); |
| 8 | 8 | |
| 9 | 9 | $reasons = array( |
| 10 | - array( |
|
| 11 | - 'id' => 'TOO_COMPLICATED', |
|
| 12 | - 'text' => esc_html__( 'It was too complicated and unclear to me', 'wordlift' ), |
|
| 13 | - 'message' => array( |
|
| 14 | - 'text' => sprintf( |
|
| 15 | - /* translators: %s: Too complicate reason. */ |
|
| 16 | - esc_html__( 'Need help? We are ready to answer your questions. %s', 'wordlift' ), |
|
| 17 | - $too_complicate_reason_label |
|
| 18 | - ), |
|
| 19 | - ), |
|
| 20 | - ), |
|
| 21 | - array( |
|
| 22 | - 'id' => 'NOT_ENOUGH_FEATURES', |
|
| 23 | - 'text' => esc_html__( 'It misses some important feature to me', 'wordlift' ), |
|
| 24 | - 'message' => array( |
|
| 25 | - 'field' => 'text', |
|
| 26 | - 'text' => esc_html__( 'Tell us what this feature is.', 'wordlift' ), |
|
| 27 | - ), |
|
| 28 | - ), |
|
| 29 | - array( |
|
| 30 | - 'id' => 'COSTS_TOO_MUCH', |
|
| 31 | - 'text' => esc_html__( 'It costs too much', 'wordlift' ), |
|
| 32 | - 'message' => array( |
|
| 33 | - 'field' => 'text', |
|
| 34 | - 'text' => esc_html__( 'How much you would like to pay?', 'wordlift' ), |
|
| 35 | - ), |
|
| 36 | - ), |
|
| 37 | - array( |
|
| 38 | - 'id' => 'FOUND_ANOTHER_TOOL', |
|
| 39 | - 'text' => esc_html__( 'I found another tool that I like better', 'wordlift' ), |
|
| 40 | - 'message' => array( |
|
| 41 | - 'field' => 'text', |
|
| 42 | - 'text' => esc_html__( 'Please tell us some more details.', 'wordlift' ), |
|
| 43 | - ), |
|
| 44 | - ), |
|
| 45 | - array( |
|
| 46 | - 'id' => 'I_DONT_USE_IT', |
|
| 47 | - 'text' => esc_html__( 'I\'m not using it right now', 'wordlift' ), |
|
| 48 | - ), |
|
| 49 | - array( |
|
| 50 | - 'id' => 'SOMETHING_DIDNT_WORK', |
|
| 51 | - 'text' => esc_html__( 'Something didn\'t work right', 'wordlift' ), |
|
| 52 | - ), |
|
| 53 | - array( |
|
| 54 | - 'id' => 'ANOTHER_REASON', |
|
| 55 | - 'text' => esc_html__( 'Another reason', 'wordlift' ), |
|
| 56 | - 'message' => array( |
|
| 57 | - 'field' => 'textarea', |
|
| 58 | - 'text' => esc_html__( 'Please tell us the reason so we can improve it.', 'wordlift' ), |
|
| 59 | - ), |
|
| 60 | - ), |
|
| 10 | + array( |
|
| 11 | + 'id' => 'TOO_COMPLICATED', |
|
| 12 | + 'text' => esc_html__( 'It was too complicated and unclear to me', 'wordlift' ), |
|
| 13 | + 'message' => array( |
|
| 14 | + 'text' => sprintf( |
|
| 15 | + /* translators: %s: Too complicate reason. */ |
|
| 16 | + esc_html__( 'Need help? We are ready to answer your questions. %s', 'wordlift' ), |
|
| 17 | + $too_complicate_reason_label |
|
| 18 | + ), |
|
| 19 | + ), |
|
| 20 | + ), |
|
| 21 | + array( |
|
| 22 | + 'id' => 'NOT_ENOUGH_FEATURES', |
|
| 23 | + 'text' => esc_html__( 'It misses some important feature to me', 'wordlift' ), |
|
| 24 | + 'message' => array( |
|
| 25 | + 'field' => 'text', |
|
| 26 | + 'text' => esc_html__( 'Tell us what this feature is.', 'wordlift' ), |
|
| 27 | + ), |
|
| 28 | + ), |
|
| 29 | + array( |
|
| 30 | + 'id' => 'COSTS_TOO_MUCH', |
|
| 31 | + 'text' => esc_html__( 'It costs too much', 'wordlift' ), |
|
| 32 | + 'message' => array( |
|
| 33 | + 'field' => 'text', |
|
| 34 | + 'text' => esc_html__( 'How much you would like to pay?', 'wordlift' ), |
|
| 35 | + ), |
|
| 36 | + ), |
|
| 37 | + array( |
|
| 38 | + 'id' => 'FOUND_ANOTHER_TOOL', |
|
| 39 | + 'text' => esc_html__( 'I found another tool that I like better', 'wordlift' ), |
|
| 40 | + 'message' => array( |
|
| 41 | + 'field' => 'text', |
|
| 42 | + 'text' => esc_html__( 'Please tell us some more details.', 'wordlift' ), |
|
| 43 | + ), |
|
| 44 | + ), |
|
| 45 | + array( |
|
| 46 | + 'id' => 'I_DONT_USE_IT', |
|
| 47 | + 'text' => esc_html__( 'I\'m not using it right now', 'wordlift' ), |
|
| 48 | + ), |
|
| 49 | + array( |
|
| 50 | + 'id' => 'SOMETHING_DIDNT_WORK', |
|
| 51 | + 'text' => esc_html__( 'Something didn\'t work right', 'wordlift' ), |
|
| 52 | + ), |
|
| 53 | + array( |
|
| 54 | + 'id' => 'ANOTHER_REASON', |
|
| 55 | + 'text' => esc_html__( 'Another reason', 'wordlift' ), |
|
| 56 | + 'message' => array( |
|
| 57 | + 'field' => 'textarea', |
|
| 58 | + 'text' => esc_html__( 'Please tell us the reason so we can improve it.', 'wordlift' ), |
|
| 59 | + ), |
|
| 60 | + ), |
|
| 61 | 61 | ); |
| 62 | 62 | ?> |
| 63 | 63 | <div class="wl-modal-deactivation-feedback" style="display: none"> |
@@ -93,15 +93,15 @@ discard block |
||
| 93 | 93 | <?php if ( ! empty( $reason['message'] ) ) : ?> |
| 94 | 94 | <div class="additional-info <?php echo ( ! empty( $reason['message']['field'] ) ) ? 'has-field' : ''; ?>"> |
| 95 | 95 | <?php |
| 96 | - if ( ! empty( $reason['message']['field'] ) ) { |
|
| 97 | - if ( 'text' === $reason['message']['field'] ) { |
|
| 98 | - echo '<input type="text" name="wl-details" class="wl-details"/>'; |
|
| 99 | - } else { |
|
| 100 | - echo '<textarea name="wl-details" class="wl-details"></textarea>'; |
|
| 101 | - } |
|
| 102 | - } |
|
| 103 | - echo wp_kses( wpautop( $reason['message']['text'] ), array( 'p' => array() ) ) |
|
| 104 | - ?> |
|
| 96 | + if ( ! empty( $reason['message']['field'] ) ) { |
|
| 97 | + if ( 'text' === $reason['message']['field'] ) { |
|
| 98 | + echo '<input type="text" name="wl-details" class="wl-details"/>'; |
|
| 99 | + } else { |
|
| 100 | + echo '<textarea name="wl-details" class="wl-details"></textarea>'; |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | + echo wp_kses( wpautop( $reason['message']['text'] ), array( 'p' => array() ) ) |
|
| 104 | + ?> |
|
| 105 | 105 | </div> |
| 106 | 106 | <?php endif ?> |
| 107 | 107 | </li> |
@@ -112,21 +112,21 @@ discard block |
||
| 112 | 112 | <div class="notes"> |
| 113 | 113 | <p> |
| 114 | 114 | <?php |
| 115 | - echo wp_kses( |
|
| 116 | - sprintf( |
|
| 117 | - /* translators: %s: link to the download your data page. */ |
|
| 118 | - __( 'Important notice: Uninstalling the plugin will delete your vocabulary.<br>Maybe you would like to <a href="%s" target="_blank">download your data</a> first.', 'wordlift' ), |
|
| 119 | - add_query_arg( array( 'page' => 'wl_download_your_data' ), admin_url( 'admin.php' ) ) |
|
| 120 | - ), |
|
| 121 | - array( |
|
| 122 | - 'br' => array(), |
|
| 123 | - 'a' => array( |
|
| 124 | - 'href' => array(), |
|
| 125 | - 'target' => array(), |
|
| 126 | - ), |
|
| 127 | - ) |
|
| 128 | - ); |
|
| 129 | - ?> |
|
| 115 | + echo wp_kses( |
|
| 116 | + sprintf( |
|
| 117 | + /* translators: %s: link to the download your data page. */ |
|
| 118 | + __( 'Important notice: Uninstalling the plugin will delete your vocabulary.<br>Maybe you would like to <a href="%s" target="_blank">download your data</a> first.', 'wordlift' ), |
|
| 119 | + add_query_arg( array( 'page' => 'wl_download_your_data' ), admin_url( 'admin.php' ) ) |
|
| 120 | + ), |
|
| 121 | + array( |
|
| 122 | + 'br' => array(), |
|
| 123 | + 'a' => array( |
|
| 124 | + 'href' => array(), |
|
| 125 | + 'target' => array(), |
|
| 126 | + ), |
|
| 127 | + ) |
|
| 128 | + ); |
|
| 129 | + ?> |
|
| 130 | 130 | </p> |
| 131 | 131 | </div> |
| 132 | 132 | |
@@ -2,60 +2,60 @@ discard block |
||
| 2 | 2 | $too_complicate_reason_label = sprintf( |
| 3 | 3 | '<a target="_blank" href="%s">%s</a>', |
| 4 | 4 | /* translators: the link https://wordlift.io/contact-us/ should be changed to language version of the page */ |
| 5 | - esc_attr__( 'https://wordlift.io/contact-us/', 'wordlift' ), |
|
| 6 | - esc_html__( 'Contact Us', 'wordlift' ) |
|
| 5 | + esc_attr__('https://wordlift.io/contact-us/', 'wordlift'), |
|
| 6 | + esc_html__('Contact Us', 'wordlift') |
|
| 7 | 7 | ); |
| 8 | 8 | |
| 9 | 9 | $reasons = array( |
| 10 | 10 | array( |
| 11 | 11 | 'id' => 'TOO_COMPLICATED', |
| 12 | - 'text' => esc_html__( 'It was too complicated and unclear to me', 'wordlift' ), |
|
| 12 | + 'text' => esc_html__('It was too complicated and unclear to me', 'wordlift'), |
|
| 13 | 13 | 'message' => array( |
| 14 | 14 | 'text' => sprintf( |
| 15 | 15 | /* translators: %s: Too complicate reason. */ |
| 16 | - esc_html__( 'Need help? We are ready to answer your questions. %s', 'wordlift' ), |
|
| 16 | + esc_html__('Need help? We are ready to answer your questions. %s', 'wordlift'), |
|
| 17 | 17 | $too_complicate_reason_label |
| 18 | 18 | ), |
| 19 | 19 | ), |
| 20 | 20 | ), |
| 21 | 21 | array( |
| 22 | 22 | 'id' => 'NOT_ENOUGH_FEATURES', |
| 23 | - 'text' => esc_html__( 'It misses some important feature to me', 'wordlift' ), |
|
| 23 | + 'text' => esc_html__('It misses some important feature to me', 'wordlift'), |
|
| 24 | 24 | 'message' => array( |
| 25 | 25 | 'field' => 'text', |
| 26 | - 'text' => esc_html__( 'Tell us what this feature is.', 'wordlift' ), |
|
| 26 | + 'text' => esc_html__('Tell us what this feature is.', 'wordlift'), |
|
| 27 | 27 | ), |
| 28 | 28 | ), |
| 29 | 29 | array( |
| 30 | 30 | 'id' => 'COSTS_TOO_MUCH', |
| 31 | - 'text' => esc_html__( 'It costs too much', 'wordlift' ), |
|
| 31 | + 'text' => esc_html__('It costs too much', 'wordlift'), |
|
| 32 | 32 | 'message' => array( |
| 33 | 33 | 'field' => 'text', |
| 34 | - 'text' => esc_html__( 'How much you would like to pay?', 'wordlift' ), |
|
| 34 | + 'text' => esc_html__('How much you would like to pay?', 'wordlift'), |
|
| 35 | 35 | ), |
| 36 | 36 | ), |
| 37 | 37 | array( |
| 38 | 38 | 'id' => 'FOUND_ANOTHER_TOOL', |
| 39 | - 'text' => esc_html__( 'I found another tool that I like better', 'wordlift' ), |
|
| 39 | + 'text' => esc_html__('I found another tool that I like better', 'wordlift'), |
|
| 40 | 40 | 'message' => array( |
| 41 | 41 | 'field' => 'text', |
| 42 | - 'text' => esc_html__( 'Please tell us some more details.', 'wordlift' ), |
|
| 42 | + 'text' => esc_html__('Please tell us some more details.', 'wordlift'), |
|
| 43 | 43 | ), |
| 44 | 44 | ), |
| 45 | 45 | array( |
| 46 | 46 | 'id' => 'I_DONT_USE_IT', |
| 47 | - 'text' => esc_html__( 'I\'m not using it right now', 'wordlift' ), |
|
| 47 | + 'text' => esc_html__('I\'m not using it right now', 'wordlift'), |
|
| 48 | 48 | ), |
| 49 | 49 | array( |
| 50 | 50 | 'id' => 'SOMETHING_DIDNT_WORK', |
| 51 | - 'text' => esc_html__( 'Something didn\'t work right', 'wordlift' ), |
|
| 51 | + 'text' => esc_html__('Something didn\'t work right', 'wordlift'), |
|
| 52 | 52 | ), |
| 53 | 53 | array( |
| 54 | 54 | 'id' => 'ANOTHER_REASON', |
| 55 | - 'text' => esc_html__( 'Another reason', 'wordlift' ), |
|
| 55 | + 'text' => esc_html__('Another reason', 'wordlift'), |
|
| 56 | 56 | 'message' => array( |
| 57 | 57 | 'field' => 'textarea', |
| 58 | - 'text' => esc_html__( 'Please tell us the reason so we can improve it.', 'wordlift' ), |
|
| 58 | + 'text' => esc_html__('Please tell us the reason so we can improve it.', 'wordlift'), |
|
| 59 | 59 | ), |
| 60 | 60 | ), |
| 61 | 61 | ); |
@@ -64,43 +64,43 @@ discard block |
||
| 64 | 64 | <div class="wl-modal"> |
| 65 | 65 | <div class="wl-modal-body"> |
| 66 | 66 | <h2> |
| 67 | - <?php esc_html_e( 'We\'re sorry to see you go!', 'wordlift' ); ?> |
|
| 67 | + <?php esc_html_e('We\'re sorry to see you go!', 'wordlift'); ?> |
|
| 68 | 68 | </h2> |
| 69 | 69 | |
| 70 | 70 | <div class="wl-modal-panel active"> |
| 71 | 71 | <h4> |
| 72 | - <?php esc_html_e( 'If you have a moment, please let us know why you are deactivating', 'wordlift' ); ?> |
|
| 72 | + <?php esc_html_e('If you have a moment, please let us know why you are deactivating', 'wordlift'); ?> |
|
| 73 | 73 | : |
| 74 | 74 | </h4> |
| 75 | 75 | |
| 76 | 76 | <ul> |
| 77 | - <?php foreach ( $reasons as $reason ) : ?> |
|
| 78 | - <li class="wl-reason-item <?php echo ( 'I_DONT_USE_IT' === $reason['id'] ) ? 'selected' : ''; ?>"> |
|
| 77 | + <?php foreach ($reasons as $reason) : ?> |
|
| 78 | + <li class="wl-reason-item <?php echo ('I_DONT_USE_IT' === $reason['id']) ? 'selected' : ''; ?>"> |
|
| 79 | 79 | <label> |
| 80 | 80 | <input |
| 81 | 81 | type="radio" |
| 82 | 82 | name="wl-code" |
| 83 | 83 | class="wl-code" |
| 84 | - <?php checked( 'I_DONT_USE_IT', $reason['id'], true ); ?> |
|
| 85 | - value="<?php echo esc_attr( $reason['id'] ); ?>" |
|
| 84 | + <?php checked('I_DONT_USE_IT', $reason['id'], true); ?> |
|
| 85 | + value="<?php echo esc_attr($reason['id']); ?>" |
|
| 86 | 86 | /> |
| 87 | 87 | |
| 88 | 88 | <span class="description"> |
| 89 | - <?php echo esc_html( $reason['text'] ); ?> |
|
| 89 | + <?php echo esc_html($reason['text']); ?> |
|
| 90 | 90 | </span> |
| 91 | 91 | </label> |
| 92 | 92 | |
| 93 | - <?php if ( ! empty( $reason['message'] ) ) : ?> |
|
| 94 | - <div class="additional-info <?php echo ( ! empty( $reason['message']['field'] ) ) ? 'has-field' : ''; ?>"> |
|
| 93 | + <?php if ( ! empty($reason['message'])) : ?> |
|
| 94 | + <div class="additional-info <?php echo ( ! empty($reason['message']['field'])) ? 'has-field' : ''; ?>"> |
|
| 95 | 95 | <?php |
| 96 | - if ( ! empty( $reason['message']['field'] ) ) { |
|
| 97 | - if ( 'text' === $reason['message']['field'] ) { |
|
| 96 | + if ( ! empty($reason['message']['field'])) { |
|
| 97 | + if ('text' === $reason['message']['field']) { |
|
| 98 | 98 | echo '<input type="text" name="wl-details" class="wl-details"/>'; |
| 99 | 99 | } else { |
| 100 | 100 | echo '<textarea name="wl-details" class="wl-details"></textarea>'; |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | - echo wp_kses( wpautop( $reason['message']['text'] ), array( 'p' => array() ) ) |
|
| 103 | + echo wp_kses(wpautop($reason['message']['text']), array('p' => array())) |
|
| 104 | 104 | ?> |
| 105 | 105 | </div> |
| 106 | 106 | <?php endif ?> |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | echo wp_kses( |
| 116 | 116 | sprintf( |
| 117 | 117 | /* translators: %s: link to the download your data page. */ |
| 118 | - __( 'Important notice: Uninstalling the plugin will delete your vocabulary.<br>Maybe you would like to <a href="%s" target="_blank">download your data</a> first.', 'wordlift' ), |
|
| 119 | - add_query_arg( array( 'page' => 'wl_download_your_data' ), admin_url( 'admin.php' ) ) |
|
| 118 | + __('Important notice: Uninstalling the plugin will delete your vocabulary.<br>Maybe you would like to <a href="%s" target="_blank">download your data</a> first.', 'wordlift'), |
|
| 119 | + add_query_arg(array('page' => 'wl_download_your_data'), admin_url('admin.php')) |
|
| 120 | 120 | ), |
| 121 | 121 | array( |
| 122 | 122 | 'br' => array(), |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | <div class="wl-modal-footer"> |
| 137 | 137 | <a href="#" class="button button-secondary wl-modal-button-close"> |
| 138 | - <?php esc_html_e( 'Cancel', 'wordlift' ); ?> |
|
| 138 | + <?php esc_html_e('Cancel', 'wordlift'); ?> |
|
| 139 | 139 | </a> |
| 140 | 140 | |
| 141 | 141 | <a href="#" class="button button-primary wl-modal-button-deactivate"> |
| 142 | - <?php esc_html_e( 'Deactivate', 'wordlift' ); ?> |
|
| 142 | + <?php esc_html_e('Deactivate', 'wordlift'); ?> |
|
| 143 | 143 | </a> |
| 144 | 144 | <div class="clear"></div> |
| 145 | 145 | </div> |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | type="hidden" |
| 149 | 149 | name="wl_deactivation_feedback_nonce" |
| 150 | 150 | class="wl_deactivation_feedback_nonce" |
| 151 | - value="<?php echo esc_attr( wp_create_nonce( 'wl_deactivation_feedback_nonce' ) ); ?>" |
|
| 151 | + value="<?php echo esc_attr(wp_create_nonce('wl_deactivation_feedback_nonce')); ?>" |
|
| 152 | 152 | > |
| 153 | 153 | </div> |
| 154 | 154 | </div> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | - exit; |
|
| 15 | + exit; |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | // Get a list of tabs filtered in by the classes that want to add them. |
@@ -20,12 +20,12 @@ discard block |
||
| 20 | 20 | // Generate a list of valid tabs that we could have to validate the input against. |
| 21 | 21 | $valid_tabs = array(); |
| 22 | 22 | foreach ( $admin_tabs as $admin_tab ) { |
| 23 | - $valid_tabs[] = $admin_tab['slug']; |
|
| 23 | + $valid_tabs[] = $admin_tab['slug']; |
|
| 24 | 24 | } |
| 25 | 25 | $input_tab = filter_input( INPUT_GET, 'tab' ); |
| 26 | 26 | $current_tab = ( in_array( $input_tab, $valid_tabs, true ) ) |
| 27 | - ? $input_tab |
|
| 28 | - : 'general'; |
|
| 27 | + ? $input_tab |
|
| 28 | + : 'general'; |
|
| 29 | 29 | |
| 30 | 30 | ?> |
| 31 | 31 | |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | <a class="nav-tab<?php echo 'general' === $current_tab ? ' nav-tab-active' : ''; ?>" |
| 36 | 36 | href="<?php echo esc_html( admin_url( 'admin.php?page=wl_configuration_admin_menu' ) ); ?>"><?php echo esc_html( __( 'General', 'wordlift' ) ); ?></a> |
| 37 | 37 | <?php |
| 38 | - foreach ( $admin_tabs as $admin_tab ) { |
|
| 39 | - ?> |
|
| 38 | + foreach ( $admin_tabs as $admin_tab ) { |
|
| 39 | + ?> |
|
| 40 | 40 | <a class="nav-tab<?php echo esc_attr( $admin_tab['slug'] === $current_tab ? ' nav-tab-active' : '' ); ?>" |
| 41 | 41 | href="<?php echo esc_url( admin_url( 'admin.php?page=wl_configuration_admin_menu&tab=' . $admin_tab['slug'] ) ); ?>"><?php echo esc_html( $admin_tab['title'] ); ?></a> |
| 42 | 42 | <?php |
| 43 | - } |
|
| 44 | - ?> |
|
| 43 | + } |
|
| 44 | + ?> |
|
| 45 | 45 | </h2> |
| 46 | 46 | |
| 47 | 47 | <?php require plugin_dir_path( __DIR__ ) . "partials/wordlift-admin-settings-$current_tab-page.php"; ?> |
@@ -11,39 +11,39 @@ |
||
| 11 | 11 | * @package Wordlift/admin |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 14 | +if ( ! defined('ABSPATH')) { |
|
| 15 | 15 | exit; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | // Get a list of tabs filtered in by the classes that want to add them. |
| 19 | -$admin_tabs = apply_filters( 'wl_admin_page_tabs', array() ); |
|
| 19 | +$admin_tabs = apply_filters('wl_admin_page_tabs', array()); |
|
| 20 | 20 | // Generate a list of valid tabs that we could have to validate the input against. |
| 21 | 21 | $valid_tabs = array(); |
| 22 | -foreach ( $admin_tabs as $admin_tab ) { |
|
| 22 | +foreach ($admin_tabs as $admin_tab) { |
|
| 23 | 23 | $valid_tabs[] = $admin_tab['slug']; |
| 24 | 24 | } |
| 25 | -$input_tab = filter_input( INPUT_GET, 'tab' ); |
|
| 26 | -$current_tab = ( in_array( $input_tab, $valid_tabs, true ) ) |
|
| 25 | +$input_tab = filter_input(INPUT_GET, 'tab'); |
|
| 26 | +$current_tab = (in_array($input_tab, $valid_tabs, true)) |
|
| 27 | 27 | ? $input_tab |
| 28 | 28 | : 'general'; |
| 29 | 29 | |
| 30 | 30 | ?> |
| 31 | 31 | |
| 32 | 32 | <div class="wrap" id="wl-settings-page"> |
| 33 | - <h2><?php esc_html_e( 'WordLift Settings', 'wordlift' ); ?></h2> |
|
| 33 | + <h2><?php esc_html_e('WordLift Settings', 'wordlift'); ?></h2> |
|
| 34 | 34 | <h2 class="nav-tab-wrapper"> |
| 35 | 35 | <a class="nav-tab<?php echo 'general' === $current_tab ? ' nav-tab-active' : ''; ?>" |
| 36 | - href="<?php echo esc_html( admin_url( 'admin.php?page=wl_configuration_admin_menu' ) ); ?>"><?php echo esc_html( __( 'General', 'wordlift' ) ); ?></a> |
|
| 36 | + href="<?php echo esc_html(admin_url('admin.php?page=wl_configuration_admin_menu')); ?>"><?php echo esc_html(__('General', 'wordlift')); ?></a> |
|
| 37 | 37 | <?php |
| 38 | - foreach ( $admin_tabs as $admin_tab ) { |
|
| 38 | + foreach ($admin_tabs as $admin_tab) { |
|
| 39 | 39 | ?> |
| 40 | - <a class="nav-tab<?php echo esc_attr( $admin_tab['slug'] === $current_tab ? ' nav-tab-active' : '' ); ?>" |
|
| 41 | - href="<?php echo esc_url( admin_url( 'admin.php?page=wl_configuration_admin_menu&tab=' . $admin_tab['slug'] ) ); ?>"><?php echo esc_html( $admin_tab['title'] ); ?></a> |
|
| 40 | + <a class="nav-tab<?php echo esc_attr($admin_tab['slug'] === $current_tab ? ' nav-tab-active' : ''); ?>" |
|
| 41 | + href="<?php echo esc_url(admin_url('admin.php?page=wl_configuration_admin_menu&tab='.$admin_tab['slug'])); ?>"><?php echo esc_html($admin_tab['title']); ?></a> |
|
| 42 | 42 | <?php |
| 43 | 43 | } |
| 44 | 44 | ?> |
| 45 | 45 | </h2> |
| 46 | 46 | |
| 47 | - <?php require plugin_dir_path( __DIR__ ) . "partials/wordlift-admin-settings-$current_tab-page.php"; ?> |
|
| 47 | + <?php require plugin_dir_path(__DIR__)."partials/wordlift-admin-settings-$current_tab-page.php"; ?> |
|
| 48 | 48 | |
| 49 | 49 | </div> |
@@ -16,49 +16,49 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | <?php |
| 18 | 18 | |
| 19 | - // Enqueue wp.media functions. |
|
| 20 | - wp_enqueue_media(); |
|
| 19 | + // Enqueue wp.media functions. |
|
| 20 | + wp_enqueue_media(); |
|
| 21 | 21 | |
| 22 | - // Enqueue styles and scripts. |
|
| 23 | - wp_enqueue_style( 'wl-font-awesome', plugin_dir_url( dirname( __DIR__ ) ) . 'css/font-awesome.min.css', array(), WORDLIFT_VERSION ); |
|
| 24 | - wp_enqueue_style( |
|
| 25 | - 'wordlift-admin-setup', |
|
| 26 | - plugin_dir_url( __DIR__ ) . 'css/wordlift-admin-setup.css', |
|
| 27 | - array( |
|
| 28 | - 'wp-admin', |
|
| 29 | - 'wl-font-awesome', |
|
| 30 | - ), |
|
| 31 | - WORDLIFT_VERSION |
|
| 32 | - ); |
|
| 33 | - wp_enqueue_script( 'wordlift-admin-setup', plugin_dir_url( __DIR__ ) . 'js/1/setup.js', array( 'jquery' ), WORDLIFT_VERSION, false ); |
|
| 22 | + // Enqueue styles and scripts. |
|
| 23 | + wp_enqueue_style( 'wl-font-awesome', plugin_dir_url( dirname( __DIR__ ) ) . 'css/font-awesome.min.css', array(), WORDLIFT_VERSION ); |
|
| 24 | + wp_enqueue_style( |
|
| 25 | + 'wordlift-admin-setup', |
|
| 26 | + plugin_dir_url( __DIR__ ) . 'css/wordlift-admin-setup.css', |
|
| 27 | + array( |
|
| 28 | + 'wp-admin', |
|
| 29 | + 'wl-font-awesome', |
|
| 30 | + ), |
|
| 31 | + WORDLIFT_VERSION |
|
| 32 | + ); |
|
| 33 | + wp_enqueue_script( 'wordlift-admin-setup', plugin_dir_url( __DIR__ ) . 'js/1/setup.js', array( 'jquery' ), WORDLIFT_VERSION, false ); |
|
| 34 | 34 | |
| 35 | - // Get wp_permalink structure |
|
| 36 | - $permalink_structure = get_option( 'permalink_structure' ); |
|
| 35 | + // Get wp_permalink structure |
|
| 36 | + $permalink_structure = get_option( 'permalink_structure' ); |
|
| 37 | 37 | |
| 38 | - // Set configuration settings. |
|
| 39 | - wp_localize_script( |
|
| 40 | - 'wordlift-admin-setup', |
|
| 41 | - '_wlAdminSetup', |
|
| 42 | - array( |
|
| 43 | - 'ajaxUrl' => wp_parse_url( self_admin_url( 'admin-ajax.php' ), PHP_URL_PATH ), |
|
| 44 | - 'action' => 'wl_validate_key', |
|
| 45 | - 'permalink' => $permalink_structure, |
|
| 46 | - 'media' => array( |
|
| 47 | - 'title' => __( 'WordLift Choose Logo', 'wordlift' ), |
|
| 48 | - 'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ), |
|
| 49 | - ), |
|
| 50 | - ) |
|
| 51 | - ); |
|
| 38 | + // Set configuration settings. |
|
| 39 | + wp_localize_script( |
|
| 40 | + 'wordlift-admin-setup', |
|
| 41 | + '_wlAdminSetup', |
|
| 42 | + array( |
|
| 43 | + 'ajaxUrl' => wp_parse_url( self_admin_url( 'admin-ajax.php' ), PHP_URL_PATH ), |
|
| 44 | + 'action' => 'wl_validate_key', |
|
| 45 | + 'permalink' => $permalink_structure, |
|
| 46 | + 'media' => array( |
|
| 47 | + 'title' => __( 'WordLift Choose Logo', 'wordlift' ), |
|
| 48 | + 'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ), |
|
| 49 | + ), |
|
| 50 | + ) |
|
| 51 | + ); |
|
| 52 | 52 | |
| 53 | - // Finally print styles and scripts. |
|
| 54 | - do_action( 'admin_print_scripts' ); |
|
| 55 | - wp_print_styles(); |
|
| 56 | - wp_print_scripts(); |
|
| 53 | + // Finally print styles and scripts. |
|
| 54 | + do_action( 'admin_print_scripts' ); |
|
| 55 | + wp_print_styles(); |
|
| 56 | + wp_print_scripts(); |
|
| 57 | 57 | |
| 58 | - for ( $i = 1; $i <= 6; $i ++ ) { |
|
| 59 | - include 'admin-setup/step-' . $i . '.php'; |
|
| 60 | - } |
|
| 61 | - ?> |
|
| 58 | + for ( $i = 1; $i <= 6; $i ++ ) { |
|
| 59 | + include 'admin-setup/step-' . $i . '.php'; |
|
| 60 | + } |
|
| 61 | + ?> |
|
| 62 | 62 | </head> |
| 63 | 63 | <body> |
| 64 | 64 | |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | <div class="viewport"></div> |
| 83 | 83 | </form> |
| 84 | 84 | <?php |
| 85 | - if ( function_exists( 'wp_print_media_templates' ) ) { |
|
| 86 | - wp_print_media_templates(); |
|
| 87 | - } |
|
| 88 | - ?> |
|
| 85 | + if ( function_exists( 'wp_print_media_templates' ) ) { |
|
| 86 | + wp_print_media_templates(); |
|
| 87 | + } |
|
| 88 | + ?> |
|
| 89 | 89 | </div> |
| 90 | 90 | |
| 91 | 91 | </body> |
@@ -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,43 +20,43 @@ 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( __DIR__ ) ) . 'css/font-awesome.min.css', array(), WORDLIFT_VERSION ); |
|
| 23 | + wp_enqueue_style('wl-font-awesome', plugin_dir_url(dirname(__DIR__)).'css/font-awesome.min.css', array(), WORDLIFT_VERSION); |
|
| 24 | 24 | wp_enqueue_style( |
| 25 | 25 | 'wordlift-admin-setup', |
| 26 | - plugin_dir_url( __DIR__ ) . 'css/wordlift-admin-setup.css', |
|
| 26 | + plugin_dir_url(__DIR__).'css/wordlift-admin-setup.css', |
|
| 27 | 27 | array( |
| 28 | 28 | 'wp-admin', |
| 29 | 29 | 'wl-font-awesome', |
| 30 | 30 | ), |
| 31 | 31 | WORDLIFT_VERSION |
| 32 | 32 | ); |
| 33 | - wp_enqueue_script( 'wordlift-admin-setup', plugin_dir_url( __DIR__ ) . 'js/1/setup.js', array( 'jquery' ), WORDLIFT_VERSION, false ); |
|
| 33 | + wp_enqueue_script('wordlift-admin-setup', plugin_dir_url(__DIR__).'js/1/setup.js', array('jquery'), WORDLIFT_VERSION, false); |
|
| 34 | 34 | |
| 35 | 35 | // Get wp_permalink structure |
| 36 | - $permalink_structure = get_option( 'permalink_structure' ); |
|
| 36 | + $permalink_structure = get_option('permalink_structure'); |
|
| 37 | 37 | |
| 38 | 38 | // Set configuration settings. |
| 39 | 39 | wp_localize_script( |
| 40 | 40 | 'wordlift-admin-setup', |
| 41 | 41 | '_wlAdminSetup', |
| 42 | 42 | array( |
| 43 | - 'ajaxUrl' => wp_parse_url( self_admin_url( 'admin-ajax.php' ), PHP_URL_PATH ), |
|
| 43 | + 'ajaxUrl' => wp_parse_url(self_admin_url('admin-ajax.php'), PHP_URL_PATH), |
|
| 44 | 44 | 'action' => 'wl_validate_key', |
| 45 | 45 | 'permalink' => $permalink_structure, |
| 46 | 46 | 'media' => array( |
| 47 | - 'title' => __( 'WordLift Choose Logo', 'wordlift' ), |
|
| 48 | - 'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ), |
|
| 47 | + 'title' => __('WordLift Choose Logo', 'wordlift'), |
|
| 48 | + 'button' => array('text' => __('Choose Logo', 'wordlift')), |
|
| 49 | 49 | ), |
| 50 | 50 | ) |
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | 53 | // Finally print styles and scripts. |
| 54 | - do_action( 'admin_print_scripts' ); |
|
| 54 | + do_action('admin_print_scripts'); |
|
| 55 | 55 | wp_print_styles(); |
| 56 | 56 | wp_print_scripts(); |
| 57 | 57 | |
| 58 | - for ( $i = 1; $i <= 6; $i ++ ) { |
|
| 59 | - include 'admin-setup/step-' . $i . '.php'; |
|
| 58 | + for ($i = 1; $i <= 6; $i++) { |
|
| 59 | + include 'admin-setup/step-'.$i.'.php'; |
|
| 60 | 60 | } |
| 61 | 61 | ?> |
| 62 | 62 | </head> |
@@ -64,25 +64,25 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | <div class="wl-container"> |
| 66 | 66 | |
| 67 | - <a href="<?php echo esc_url( admin_url() ); ?>" |
|
| 67 | + <a href="<?php echo esc_url(admin_url()); ?>" |
|
| 68 | 68 | class="fa fa-times wl-close"></a> |
| 69 | 69 | |
| 70 | 70 | <header> |
| 71 | 71 | <h1><img class="wizard-logo" |
| 72 | - src="<?php echo esc_attr( plugin_dir_url( dirname( __DIR__ ) ) . 'images/logo-wl-transparent-240x90.png' ); ?>"/> |
|
| 72 | + src="<?php echo esc_attr(plugin_dir_url(dirname(__DIR__)).'images/logo-wl-transparent-240x90.png'); ?>"/> |
|
| 73 | 73 | </h1> |
| 74 | 74 | <img class="shapes" |
| 75 | - src="<?php echo esc_attr( plugin_dir_url( dirname( __DIR__ ) ) . 'images/shapes.png' ); ?>"/> |
|
| 75 | + src="<?php echo esc_attr(plugin_dir_url(dirname(__DIR__)).'images/shapes.png'); ?>"/> |
|
| 76 | 76 | </header> |
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | <form method="post"> |
| 80 | - <?php wp_nonce_field( 'wl-save-configuration' ); ?> |
|
| 80 | + <?php wp_nonce_field('wl-save-configuration'); ?> |
|
| 81 | 81 | <input type="hidden" name="action" value="wl-save-configuration"/> |
| 82 | 82 | <div class="viewport"></div> |
| 83 | 83 | </form> |
| 84 | 84 | <?php |
| 85 | - if ( function_exists( 'wp_print_media_templates' ) ) { |
|
| 85 | + if (function_exists('wp_print_media_templates')) { |
|
| 86 | 86 | wp_print_media_templates(); |
| 87 | 87 | } |
| 88 | 88 | ?> |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | - exit; |
|
| 14 | + exit; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 21 | 21 | $term_settings = $settings !== null ? $settings : array( |
| 22 | - 'title' => '', |
|
| 23 | - 'description' => '', |
|
| 22 | + 'title' => '', |
|
| 23 | + 'description' => '', |
|
| 24 | 24 | ); |
| 25 | 25 | |
| 26 | 26 | ?> |
@@ -33,36 +33,36 @@ discard block |
||
| 33 | 33 | <input type="hidden" name="tag_ID" |
| 34 | 34 | value=" |
| 35 | 35 | <?php |
| 36 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 37 | - echo esc_attr( $term_id ); |
|
| 38 | - ?> |
|
| 36 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 37 | + echo esc_attr( $term_id ); |
|
| 38 | + ?> |
|
| 39 | 39 | " /> |
| 40 | 40 | <input type="hidden" name="action" value="wl_edit_entity_type_term" /> |
| 41 | 41 | <?php |
| 42 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 43 | - wp_nonce_field( 'update-entity_type_term_' . $term_id ); |
|
| 44 | - ?> |
|
| 42 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 43 | + wp_nonce_field( 'update-entity_type_term_' . $term_id ); |
|
| 44 | + ?> |
|
| 45 | 45 | <table class="form-table"> |
| 46 | 46 | <tr class="form-field form-required term-name-wrap"> |
| 47 | 47 | <th scope="row"> |
| 48 | 48 | <label> |
| 49 | 49 | <?php |
| 50 | - esc_html_e( 'Name', 'wordlift' ); |
|
| 51 | - ?> |
|
| 50 | + esc_html_e( 'Name', 'wordlift' ); |
|
| 51 | + ?> |
|
| 52 | 52 | </label> |
| 53 | 53 | </th> |
| 54 | 54 | <td> |
| 55 | 55 | <?php |
| 56 | - echo esc_html( $current_term->name ) |
|
| 57 | - ?> |
|
| 56 | + echo esc_html( $current_term->name ) |
|
| 57 | + ?> |
|
| 58 | 58 | </td> |
| 59 | 59 | </tr> |
| 60 | 60 | <tr class="form-field form-required term-name-wrap"> |
| 61 | 61 | <th scope="row"> |
| 62 | 62 | <label for="title"> |
| 63 | 63 | <?php |
| 64 | - esc_html_e( 'Title', 'wordlift' ); |
|
| 65 | - ?> |
|
| 64 | + esc_html_e( 'Title', 'wordlift' ); |
|
| 65 | + ?> |
|
| 66 | 66 | </label> |
| 67 | 67 | </th> |
| 68 | 68 | <td><input name="title" id="title" type="text" |
@@ -70,24 +70,24 @@ discard block |
||
| 70 | 70 | size="40" /> |
| 71 | 71 | <p class="description"> |
| 72 | 72 | <?php |
| 73 | - esc_html_e( 'The HTML title to be used in the entity type archive page.', 'wordlift' ); |
|
| 74 | - ?> |
|
| 73 | + esc_html_e( 'The HTML title to be used in the entity type archive page.', 'wordlift' ); |
|
| 74 | + ?> |
|
| 75 | 75 | </p> |
| 76 | 76 | </td> |
| 77 | 77 | </tr> |
| 78 | 78 | <tr class="form-field term-description-wrap"> |
| 79 | 79 | <th scope="row"><label for="description"> |
| 80 | 80 | <?php |
| 81 | - esc_html_e( 'Description', 'wordlift' ); |
|
| 82 | - ?> |
|
| 81 | + esc_html_e( 'Description', 'wordlift' ); |
|
| 82 | + ?> |
|
| 83 | 83 | </label> |
| 84 | 84 | </th> |
| 85 | 85 | <td><textarea name="description" id="description" rows="5" |
| 86 | 86 | cols="50" class="large-text"><?php echo esc_html( $term_settings['description'] ); ?></textarea> |
| 87 | 87 | <p class="description"> |
| 88 | 88 | <?php |
| 89 | - esc_html_e( 'The description to be used in the entity type archive page.', 'wordlift' ); |
|
| 90 | - ?> |
|
| 89 | + esc_html_e( 'The description to be used in the entity type archive page.', 'wordlift' ); |
|
| 90 | + ?> |
|
| 91 | 91 | </p> |
| 92 | 92 | </td> |
| 93 | 93 | </tr> |
@@ -10,12 +10,12 @@ discard block |
||
| 10 | 10 | * @subpackage Wordlift/admin/partials |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 18 | -$current_term = get_term( $term_id, 'wl_entity_type' ); |
|
| 18 | +$current_term = get_term($term_id, 'wl_entity_type'); |
|
| 19 | 19 | |
| 20 | 20 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 21 | 21 | $term_settings = $settings !== null ? $settings : array( |
@@ -25,35 +25,35 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | ?> |
| 27 | 27 | <div class="wrap"> |
| 28 | - <h1><?php esc_html_e( 'Edit Entity Type', 'wordlift' ); ?></h1> |
|
| 28 | + <h1><?php esc_html_e('Edit Entity Type', 'wordlift'); ?></h1> |
|
| 29 | 29 | |
| 30 | 30 | <form name="edittag" id="edittag" method="post" |
| 31 | - action="<?php echo esc_html( admin_url( 'admin.php?page=wl_entity_type_settings' ) ); ?>" |
|
| 31 | + action="<?php echo esc_html(admin_url('admin.php?page=wl_entity_type_settings')); ?>" |
|
| 32 | 32 | class="validate"> |
| 33 | 33 | <input type="hidden" name="tag_ID" |
| 34 | 34 | value=" |
| 35 | 35 | <?php |
| 36 | 36 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 37 | - echo esc_attr( $term_id ); |
|
| 37 | + echo esc_attr($term_id); |
|
| 38 | 38 | ?> |
| 39 | 39 | " /> |
| 40 | 40 | <input type="hidden" name="action" value="wl_edit_entity_type_term" /> |
| 41 | 41 | <?php |
| 42 | 42 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 43 | - wp_nonce_field( 'update-entity_type_term_' . $term_id ); |
|
| 43 | + wp_nonce_field('update-entity_type_term_'.$term_id); |
|
| 44 | 44 | ?> |
| 45 | 45 | <table class="form-table"> |
| 46 | 46 | <tr class="form-field form-required term-name-wrap"> |
| 47 | 47 | <th scope="row"> |
| 48 | 48 | <label> |
| 49 | 49 | <?php |
| 50 | - esc_html_e( 'Name', 'wordlift' ); |
|
| 50 | + esc_html_e('Name', 'wordlift'); |
|
| 51 | 51 | ?> |
| 52 | 52 | </label> |
| 53 | 53 | </th> |
| 54 | 54 | <td> |
| 55 | 55 | <?php |
| 56 | - echo esc_html( $current_term->name ) |
|
| 56 | + echo esc_html($current_term->name) |
|
| 57 | 57 | ?> |
| 58 | 58 | </td> |
| 59 | 59 | </tr> |
@@ -61,16 +61,16 @@ discard block |
||
| 61 | 61 | <th scope="row"> |
| 62 | 62 | <label for="title"> |
| 63 | 63 | <?php |
| 64 | - esc_html_e( 'Title', 'wordlift' ); |
|
| 64 | + esc_html_e('Title', 'wordlift'); |
|
| 65 | 65 | ?> |
| 66 | 66 | </label> |
| 67 | 67 | </th> |
| 68 | 68 | <td><input name="title" id="title" type="text" |
| 69 | - value="<?php echo esc_attr( $term_settings['title'] ); ?>" |
|
| 69 | + value="<?php echo esc_attr($term_settings['title']); ?>" |
|
| 70 | 70 | size="40" /> |
| 71 | 71 | <p class="description"> |
| 72 | 72 | <?php |
| 73 | - esc_html_e( 'The HTML title to be used in the entity type archive page.', 'wordlift' ); |
|
| 73 | + esc_html_e('The HTML title to be used in the entity type archive page.', 'wordlift'); |
|
| 74 | 74 | ?> |
| 75 | 75 | </p> |
| 76 | 76 | </td> |
@@ -78,20 +78,20 @@ discard block |
||
| 78 | 78 | <tr class="form-field term-description-wrap"> |
| 79 | 79 | <th scope="row"><label for="description"> |
| 80 | 80 | <?php |
| 81 | - esc_html_e( 'Description', 'wordlift' ); |
|
| 81 | + esc_html_e('Description', 'wordlift'); |
|
| 82 | 82 | ?> |
| 83 | 83 | </label> |
| 84 | 84 | </th> |
| 85 | 85 | <td><textarea name="description" id="description" rows="5" |
| 86 | - cols="50" class="large-text"><?php echo esc_html( $term_settings['description'] ); ?></textarea> |
|
| 86 | + cols="50" class="large-text"><?php echo esc_html($term_settings['description']); ?></textarea> |
|
| 87 | 87 | <p class="description"> |
| 88 | 88 | <?php |
| 89 | - esc_html_e( 'The description to be used in the entity type archive page.', 'wordlift' ); |
|
| 89 | + esc_html_e('The description to be used in the entity type archive page.', 'wordlift'); |
|
| 90 | 90 | ?> |
| 91 | 91 | </p> |
| 92 | 92 | </td> |
| 93 | 93 | </tr> |
| 94 | 94 | </table> |
| 95 | - <?php submit_button( __( 'Update', 'default' ) ); ?> |
|
| 95 | + <?php submit_button(__('Update', 'default')); ?> |
|
| 96 | 96 | </form> |
| 97 | 97 | </div> |
@@ -9,8 +9,8 @@ discard block |
||
| 9 | 9 | * @package Wordlift |
| 10 | 10 | * @subpackage Wordlift/includes |
| 11 | 11 | */ |
| 12 | -if ( ! class_exists( 'Walker_Category_Checklist' ) ) { |
|
| 13 | - require_once ABSPATH . 'wp-admin/includes/template.php'; |
|
| 12 | +if ( ! class_exists('Walker_Category_Checklist')) { |
|
| 13 | + require_once ABSPATH.'wp-admin/includes/template.php'; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | /** |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @return array An array of arguments, with this walker in case the taxonomy is the Entity Type taxonomy. |
| 38 | 38 | */ |
| 39 | - public function terms_checklist_args( $args ) { |
|
| 39 | + public function terms_checklist_args($args) { |
|
| 40 | 40 | |
| 41 | - if ( ! isset( $args['taxonomy'] ) || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy'] ) { |
|
| 41 | + if ( ! isset($args['taxonomy']) || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy']) { |
|
| 42 | 42 | return $args; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -66,16 +66,16 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @return string The hierarchical item output. |
| 68 | 68 | */ |
| 69 | - public function walk( $elements, $max_depth, ...$args ) { |
|
| 69 | + public function walk($elements, $max_depth, ...$args) { |
|
| 70 | 70 | |
| 71 | 71 | // `max_depth` force to -1 to display a flat taxonomy. |
| 72 | 72 | // |
| 73 | 73 | // See https://github.com/insideout10/wordlift-plugin/issues/305 |
| 74 | - $output = parent::walk( $elements, - 1, ...$args ); |
|
| 74 | + $output = parent::walk($elements, - 1, ...$args); |
|
| 75 | 75 | |
| 76 | 76 | $output = str_replace( |
| 77 | - array( 'type="checkbox"', "type='checkbox'" ), |
|
| 78 | - array( 'type="radio"', "type='radio'" ), |
|
| 77 | + array('type="checkbox"', "type='checkbox'"), |
|
| 78 | + array('type="radio"', "type='radio'"), |
|
| 79 | 79 | $output |
| 80 | 80 | ); |
| 81 | 81 | |
@@ -93,17 +93,17 @@ discard block |
||
| 93 | 93 | * @param array $args An array of arguments. @see wp_terms_checklist() |
| 94 | 94 | * @param int $id ID of the current term. |
| 95 | 95 | */ |
| 96 | - public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { |
|
| 96 | + public function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0) { |
|
| 97 | 97 | global $post; |
| 98 | 98 | |
| 99 | - if ( ! isset( $post ) ) { |
|
| 99 | + if ( ! isset($post)) { |
|
| 100 | 100 | return; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - if ( Wordlift_Entity_Service::TYPE_NAME !== $post->post_type |
|
| 103 | + if (Wordlift_Entity_Service::TYPE_NAME !== $post->post_type |
|
| 104 | 104 | || 'article' !== $category->slug |
| 105 | - || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy'] ) { |
|
| 106 | - parent::start_el( $output, $category, $depth, $args, $id ); |
|
| 105 | + || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy']) { |
|
| 106 | + parent::start_el($output, $category, $depth, $args, $id); |
|
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
@@ -117,17 +117,17 @@ discard block |
||
| 117 | 117 | * @param int $depth Depth of the term in reference to parents. Default 0. |
| 118 | 118 | * @param array $args An array of arguments. @see wp_terms_checklist() |
| 119 | 119 | */ |
| 120 | - public function end_el( &$output, $category, $depth = 0, $args = array() ) { |
|
| 120 | + public function end_el(&$output, $category, $depth = 0, $args = array()) { |
|
| 121 | 121 | global $post; |
| 122 | 122 | |
| 123 | - if ( ! isset( $post ) ) { |
|
| 123 | + if ( ! isset($post)) { |
|
| 124 | 124 | return; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if ( Wordlift_Entity_Service::TYPE_NAME !== $post->post_type |
|
| 127 | + if (Wordlift_Entity_Service::TYPE_NAME !== $post->post_type |
|
| 128 | 128 | || 'article' !== $category->slug |
| 129 | - || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy'] ) { |
|
| 130 | - parent::end_el( $output, $category, $depth, $args ); |
|
| 129 | + || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy']) { |
|
| 130 | + parent::end_el($output, $category, $depth, $args); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @subpackage Wordlift/includes |
| 11 | 11 | */ |
| 12 | 12 | if ( ! class_exists( 'Walker_Category_Checklist' ) ) { |
| 13 | - require_once ABSPATH . 'wp-admin/includes/template.php'; |
|
| 13 | + require_once ABSPATH . 'wp-admin/includes/template.php'; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | /** |
@@ -24,113 +24,113 @@ discard block |
||
| 24 | 24 | // phpcs:ignore Generic.Classes.DuplicateClassName.Found |
| 25 | 25 | class Wordlift_Entity_Types_Taxonomy_Walker extends Walker_Category_Checklist { |
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Entity taxonomy metabox must show exclusive options, no checkboxes. |
|
| 29 | - * |
|
| 30 | - * @since 3.1.0 |
|
| 31 | - * |
|
| 32 | - * @param $args { |
|
| 33 | - * An array of arguments. |
|
| 34 | - * |
|
| 35 | - * @type string $taxonomy The taxonomy name. |
|
| 36 | - * } |
|
| 37 | - * |
|
| 38 | - * @return array An array of arguments, with this walker in case the taxonomy is the Entity Type taxonomy. |
|
| 39 | - */ |
|
| 40 | - public function terms_checklist_args( $args ) { |
|
| 41 | - |
|
| 42 | - if ( ! isset( $args['taxonomy'] ) || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy'] ) { |
|
| 43 | - return $args; |
|
| 44 | - } |
|
| 45 | - |
|
| 46 | - // We override the way WP prints the taxonomy metabox HTML. |
|
| 47 | - $args['walker'] = $this; |
|
| 48 | - $args['checked_ontop'] = false; |
|
| 49 | - |
|
| 50 | - return $args; |
|
| 51 | - |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * Change checkboxes to radios. |
|
| 56 | - * |
|
| 57 | - * $max_depth = -1 means flatly display every element. |
|
| 58 | - * $max_depth = 0 means display all levels. |
|
| 59 | - * $max_depth > 0 specifies the number of display levels. |
|
| 60 | - * |
|
| 61 | - * @since 3.1.0 |
|
| 62 | - * |
|
| 63 | - * @param array $elements An array of elements. |
|
| 64 | - * @param int $max_depth The maximum hierarchical depth. |
|
| 65 | - * |
|
| 66 | - * @param array $args Additional arguments. |
|
| 67 | - * |
|
| 68 | - * @return string The hierarchical item output. |
|
| 69 | - */ |
|
| 70 | - public function walk( $elements, $max_depth, ...$args ) { |
|
| 71 | - |
|
| 72 | - // `max_depth` force to -1 to display a flat taxonomy. |
|
| 73 | - // |
|
| 74 | - // See https://github.com/insideout10/wordlift-plugin/issues/305 |
|
| 75 | - $output = parent::walk( $elements, - 1, ...$args ); |
|
| 76 | - |
|
| 77 | - $output = str_replace( |
|
| 78 | - array( 'type="checkbox"', "type='checkbox'" ), |
|
| 79 | - array( 'type="radio"', "type='radio'" ), |
|
| 80 | - $output |
|
| 81 | - ); |
|
| 82 | - |
|
| 83 | - return $output; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * Start the element output, output nothing in case of article term. |
|
| 88 | - * |
|
| 89 | - * @since 3.15.0 |
|
| 90 | - * |
|
| 91 | - * @param string $output Passed by reference. Used to append additional content. |
|
| 92 | - * @param object $category The current term object. |
|
| 93 | - * @param int $depth Depth of the term in reference to parents. Default 0. |
|
| 94 | - * @param array $args An array of arguments. @see wp_terms_checklist() |
|
| 95 | - * @param int $id ID of the current term. |
|
| 96 | - */ |
|
| 97 | - public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { |
|
| 98 | - global $post; |
|
| 99 | - |
|
| 100 | - if ( ! isset( $post ) ) { |
|
| 101 | - return; |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - if ( Wordlift_Entity_Service::TYPE_NAME !== $post->post_type |
|
| 105 | - || 'article' !== $category->slug |
|
| 106 | - || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy'] ) { |
|
| 107 | - parent::start_el( $output, $category, $depth, $args, $id ); |
|
| 108 | - } |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * End the element output, output nothing in case of article term. |
|
| 113 | - * |
|
| 114 | - * @since 3.15.0 |
|
| 115 | - * |
|
| 116 | - * @param string $output Passed by reference. Used to append additional content. |
|
| 117 | - * @param object $category The current term object. |
|
| 118 | - * @param int $depth Depth of the term in reference to parents. Default 0. |
|
| 119 | - * @param array $args An array of arguments. @see wp_terms_checklist() |
|
| 120 | - */ |
|
| 121 | - public function end_el( &$output, $category, $depth = 0, $args = array() ) { |
|
| 122 | - global $post; |
|
| 123 | - |
|
| 124 | - if ( ! isset( $post ) ) { |
|
| 125 | - return; |
|
| 126 | - } |
|
| 127 | - |
|
| 128 | - if ( Wordlift_Entity_Service::TYPE_NAME !== $post->post_type |
|
| 129 | - || 'article' !== $category->slug |
|
| 130 | - || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy'] ) { |
|
| 131 | - parent::end_el( $output, $category, $depth, $args ); |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - } |
|
| 27 | + /** |
|
| 28 | + * Entity taxonomy metabox must show exclusive options, no checkboxes. |
|
| 29 | + * |
|
| 30 | + * @since 3.1.0 |
|
| 31 | + * |
|
| 32 | + * @param $args { |
|
| 33 | + * An array of arguments. |
|
| 34 | + * |
|
| 35 | + * @type string $taxonomy The taxonomy name. |
|
| 36 | + * } |
|
| 37 | + * |
|
| 38 | + * @return array An array of arguments, with this walker in case the taxonomy is the Entity Type taxonomy. |
|
| 39 | + */ |
|
| 40 | + public function terms_checklist_args( $args ) { |
|
| 41 | + |
|
| 42 | + if ( ! isset( $args['taxonomy'] ) || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy'] ) { |
|
| 43 | + return $args; |
|
| 44 | + } |
|
| 45 | + |
|
| 46 | + // We override the way WP prints the taxonomy metabox HTML. |
|
| 47 | + $args['walker'] = $this; |
|
| 48 | + $args['checked_ontop'] = false; |
|
| 49 | + |
|
| 50 | + return $args; |
|
| 51 | + |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * Change checkboxes to radios. |
|
| 56 | + * |
|
| 57 | + * $max_depth = -1 means flatly display every element. |
|
| 58 | + * $max_depth = 0 means display all levels. |
|
| 59 | + * $max_depth > 0 specifies the number of display levels. |
|
| 60 | + * |
|
| 61 | + * @since 3.1.0 |
|
| 62 | + * |
|
| 63 | + * @param array $elements An array of elements. |
|
| 64 | + * @param int $max_depth The maximum hierarchical depth. |
|
| 65 | + * |
|
| 66 | + * @param array $args Additional arguments. |
|
| 67 | + * |
|
| 68 | + * @return string The hierarchical item output. |
|
| 69 | + */ |
|
| 70 | + public function walk( $elements, $max_depth, ...$args ) { |
|
| 71 | + |
|
| 72 | + // `max_depth` force to -1 to display a flat taxonomy. |
|
| 73 | + // |
|
| 74 | + // See https://github.com/insideout10/wordlift-plugin/issues/305 |
|
| 75 | + $output = parent::walk( $elements, - 1, ...$args ); |
|
| 76 | + |
|
| 77 | + $output = str_replace( |
|
| 78 | + array( 'type="checkbox"', "type='checkbox'" ), |
|
| 79 | + array( 'type="radio"', "type='radio'" ), |
|
| 80 | + $output |
|
| 81 | + ); |
|
| 82 | + |
|
| 83 | + return $output; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * Start the element output, output nothing in case of article term. |
|
| 88 | + * |
|
| 89 | + * @since 3.15.0 |
|
| 90 | + * |
|
| 91 | + * @param string $output Passed by reference. Used to append additional content. |
|
| 92 | + * @param object $category The current term object. |
|
| 93 | + * @param int $depth Depth of the term in reference to parents. Default 0. |
|
| 94 | + * @param array $args An array of arguments. @see wp_terms_checklist() |
|
| 95 | + * @param int $id ID of the current term. |
|
| 96 | + */ |
|
| 97 | + public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { |
|
| 98 | + global $post; |
|
| 99 | + |
|
| 100 | + if ( ! isset( $post ) ) { |
|
| 101 | + return; |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + if ( Wordlift_Entity_Service::TYPE_NAME !== $post->post_type |
|
| 105 | + || 'article' !== $category->slug |
|
| 106 | + || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy'] ) { |
|
| 107 | + parent::start_el( $output, $category, $depth, $args, $id ); |
|
| 108 | + } |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * End the element output, output nothing in case of article term. |
|
| 113 | + * |
|
| 114 | + * @since 3.15.0 |
|
| 115 | + * |
|
| 116 | + * @param string $output Passed by reference. Used to append additional content. |
|
| 117 | + * @param object $category The current term object. |
|
| 118 | + * @param int $depth Depth of the term in reference to parents. Default 0. |
|
| 119 | + * @param array $args An array of arguments. @see wp_terms_checklist() |
|
| 120 | + */ |
|
| 121 | + public function end_el( &$output, $category, $depth = 0, $args = array() ) { |
|
| 122 | + global $post; |
|
| 123 | + |
|
| 124 | + if ( ! isset( $post ) ) { |
|
| 125 | + return; |
|
| 126 | + } |
|
| 127 | + |
|
| 128 | + if ( Wordlift_Entity_Service::TYPE_NAME !== $post->post_type |
|
| 129 | + || 'article' !== $category->slug |
|
| 130 | + || Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME !== $args['taxonomy'] ) { |
|
| 131 | + parent::end_el( $output, $category, $depth, $args ); |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | 136 | } |
@@ -17,28 +17,28 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function wl_serialize_entity( $entity ) { |
| 19 | 19 | |
| 20 | - $entity = ( is_numeric( $entity ) ) ? get_post( $entity ) : $entity; |
|
| 20 | + $entity = ( is_numeric( $entity ) ) ? get_post( $entity ) : $entity; |
|
| 21 | 21 | |
| 22 | - // Bail if the entity doesn't exists. |
|
| 23 | - // In some cases we have `wl_topic` meta |
|
| 24 | - // pointing to an entity that has been deleted. |
|
| 25 | - if ( empty( $entity ) ) { |
|
| 26 | - return; |
|
| 27 | - } |
|
| 22 | + // Bail if the entity doesn't exists. |
|
| 23 | + // In some cases we have `wl_topic` meta |
|
| 24 | + // pointing to an entity that has been deleted. |
|
| 25 | + if ( empty( $entity ) ) { |
|
| 26 | + return; |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - $type = Wordlift_Entity_Type_Service::get_instance()->get( $entity->ID ); |
|
| 30 | - $images = wl_get_image_urls( $entity->ID ); |
|
| 29 | + $type = Wordlift_Entity_Type_Service::get_instance()->get( $entity->ID ); |
|
| 30 | + $images = wl_get_image_urls( $entity->ID ); |
|
| 31 | 31 | |
| 32 | - return array( |
|
| 33 | - 'id' => wl_get_entity_uri( $entity->ID ), |
|
| 34 | - 'label' => $entity->post_title, |
|
| 35 | - 'description' => $entity->post_content, |
|
| 36 | - 'sameAs' => wl_schema_get_value( $entity->ID, 'sameAs' ), |
|
| 37 | - 'mainType' => str_replace( 'wl-', '', $type['css_class'] ), |
|
| 38 | - 'types' => wl_get_entity_rdf_types( $entity->ID ), |
|
| 39 | - 'images' => $images, |
|
| 32 | + return array( |
|
| 33 | + 'id' => wl_get_entity_uri( $entity->ID ), |
|
| 34 | + 'label' => $entity->post_title, |
|
| 35 | + 'description' => $entity->post_content, |
|
| 36 | + 'sameAs' => wl_schema_get_value( $entity->ID, 'sameAs' ), |
|
| 37 | + 'mainType' => str_replace( 'wl-', '', $type['css_class'] ), |
|
| 38 | + 'types' => wl_get_entity_rdf_types( $entity->ID ), |
|
| 39 | + 'images' => $images, |
|
| 40 | 40 | |
| 41 | - ); |
|
| 41 | + ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -51,29 +51,29 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | function wl_remove_text_annotations( $data ) { |
| 53 | 53 | |
| 54 | - // Remove blank elements that can interfere with annotations removing |
|
| 55 | - // See https://github.com/insideout10/wordlift-plugin/issues/234 |
|
| 56 | - // Just blank span tags without any attributes are cleaned up. |
|
| 57 | - // Restrict removal to empty spans only as we may impact valid empty elements like: <th> |
|
| 58 | - $pattern = '/<span><\/span>/im'; |
|
| 59 | - // Remove the pattern while it is found (match nested annotations). |
|
| 60 | - while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 61 | - $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], - 1, $count ); |
|
| 62 | - } |
|
| 63 | - // Remove text annotations |
|
| 64 | - // <span class="textannotation" id="urn:enhancement-777cbed4-b131-00fb-54a4-ed9b26ae57ea">. |
|
| 54 | + // Remove blank elements that can interfere with annotations removing |
|
| 55 | + // See https://github.com/insideout10/wordlift-plugin/issues/234 |
|
| 56 | + // Just blank span tags without any attributes are cleaned up. |
|
| 57 | + // Restrict removal to empty spans only as we may impact valid empty elements like: <th> |
|
| 58 | + $pattern = '/<span><\/span>/im'; |
|
| 59 | + // Remove the pattern while it is found (match nested annotations). |
|
| 60 | + while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 61 | + $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], - 1, $count ); |
|
| 62 | + } |
|
| 63 | + // Remove text annotations |
|
| 64 | + // <span class="textannotation" id="urn:enhancement-777cbed4-b131-00fb-54a4-ed9b26ae57ea">. |
|
| 65 | 65 | |
| 66 | - // @see https://github.com/insideout10/wordlift-plugin/issues/771 |
|
| 67 | - // Changing this: |
|
| 68 | - // $pattern = '/<(\w+)[^>]*\sclass=\\\"textannotation(?![^\\"]*\sdisambiguated)[^\\"]*\\\"[^>]*>([^<]+)<\/\1>/im'; |
|
| 69 | - // to: |
|
| 70 | - $pattern = '/<(\w+)[^>]*\sclass=\\\"textannotation(?![^\\"]*\sdisambiguated)[^\\"]*\\\"[^>]*>(.*?)<\/\1>/im'; |
|
| 71 | - // Remove the pattern while it is found (match nested annotations). |
|
| 72 | - while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 73 | - $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], - 1, $count ); |
|
| 74 | - } |
|
| 66 | + // @see https://github.com/insideout10/wordlift-plugin/issues/771 |
|
| 67 | + // Changing this: |
|
| 68 | + // $pattern = '/<(\w+)[^>]*\sclass=\\\"textannotation(?![^\\"]*\sdisambiguated)[^\\"]*\\\"[^>]*>([^<]+)<\/\1>/im'; |
|
| 69 | + // to: |
|
| 70 | + $pattern = '/<(\w+)[^>]*\sclass=\\\"textannotation(?![^\\"]*\sdisambiguated)[^\\"]*\\\"[^>]*>(.*?)<\/\1>/im'; |
|
| 71 | + // Remove the pattern while it is found (match nested annotations). |
|
| 72 | + while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 73 | + $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], - 1, $count ); |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - return $data; |
|
| 76 | + return $data; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | add_filter( 'wp_insert_post_data', 'wl_remove_text_annotations', '98', 1 ); |
@@ -88,5 +88,5 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | function wl_admin_metaboxes_add_css_class( $classes = array() ) { |
| 90 | 90 | |
| 91 | - return array_merge( $classes, array( 'wl-metabox' ) ); |
|
| 91 | + return array_merge( $classes, array( 'wl-metabox' ) ); |
|
| 92 | 92 | } |
@@ -15,27 +15,27 @@ discard block |
||
| 15 | 15 | * |
| 16 | 16 | * @return array mixed The entity data array. |
| 17 | 17 | */ |
| 18 | -function wl_serialize_entity( $entity ) { |
|
| 18 | +function wl_serialize_entity($entity) { |
|
| 19 | 19 | |
| 20 | - $entity = ( is_numeric( $entity ) ) ? get_post( $entity ) : $entity; |
|
| 20 | + $entity = (is_numeric($entity)) ? get_post($entity) : $entity; |
|
| 21 | 21 | |
| 22 | 22 | // Bail if the entity doesn't exists. |
| 23 | 23 | // In some cases we have `wl_topic` meta |
| 24 | 24 | // pointing to an entity that has been deleted. |
| 25 | - if ( empty( $entity ) ) { |
|
| 25 | + if (empty($entity)) { |
|
| 26 | 26 | return; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - $type = Wordlift_Entity_Type_Service::get_instance()->get( $entity->ID ); |
|
| 30 | - $images = wl_get_image_urls( $entity->ID ); |
|
| 29 | + $type = Wordlift_Entity_Type_Service::get_instance()->get($entity->ID); |
|
| 30 | + $images = wl_get_image_urls($entity->ID); |
|
| 31 | 31 | |
| 32 | 32 | return array( |
| 33 | - 'id' => wl_get_entity_uri( $entity->ID ), |
|
| 33 | + 'id' => wl_get_entity_uri($entity->ID), |
|
| 34 | 34 | 'label' => $entity->post_title, |
| 35 | 35 | 'description' => $entity->post_content, |
| 36 | - 'sameAs' => wl_schema_get_value( $entity->ID, 'sameAs' ), |
|
| 37 | - 'mainType' => str_replace( 'wl-', '', $type['css_class'] ), |
|
| 38 | - 'types' => wl_get_entity_rdf_types( $entity->ID ), |
|
| 36 | + 'sameAs' => wl_schema_get_value($entity->ID, 'sameAs'), |
|
| 37 | + 'mainType' => str_replace('wl-', '', $type['css_class']), |
|
| 38 | + 'types' => wl_get_entity_rdf_types($entity->ID), |
|
| 39 | 39 | 'images' => $images, |
| 40 | 40 | |
| 41 | 41 | ); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @return array mixed The post data array. |
| 50 | 50 | * @since 1.0.0 |
| 51 | 51 | */ |
| 52 | -function wl_remove_text_annotations( $data ) { |
|
| 52 | +function wl_remove_text_annotations($data) { |
|
| 53 | 53 | |
| 54 | 54 | // Remove blank elements that can interfere with annotations removing |
| 55 | 55 | // See https://github.com/insideout10/wordlift-plugin/issues/234 |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | // Restrict removal to empty spans only as we may impact valid empty elements like: <th> |
| 58 | 58 | $pattern = '/<span><\/span>/im'; |
| 59 | 59 | // Remove the pattern while it is found (match nested annotations). |
| 60 | - while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 61 | - $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], - 1, $count ); |
|
| 60 | + while (1 === preg_match($pattern, $data['post_content'])) { |
|
| 61 | + $data['post_content'] = preg_replace($pattern, '$2', $data['post_content'], - 1, $count); |
|
| 62 | 62 | } |
| 63 | 63 | // Remove text annotations |
| 64 | 64 | // <span class="textannotation" id="urn:enhancement-777cbed4-b131-00fb-54a4-ed9b26ae57ea">. |
@@ -69,14 +69,14 @@ discard block |
||
| 69 | 69 | // to: |
| 70 | 70 | $pattern = '/<(\w+)[^>]*\sclass=\\\"textannotation(?![^\\"]*\sdisambiguated)[^\\"]*\\\"[^>]*>(.*?)<\/\1>/im'; |
| 71 | 71 | // Remove the pattern while it is found (match nested annotations). |
| 72 | - while ( 1 === preg_match( $pattern, $data['post_content'] ) ) { |
|
| 73 | - $data['post_content'] = preg_replace( $pattern, '$2', $data['post_content'], - 1, $count ); |
|
| 72 | + while (1 === preg_match($pattern, $data['post_content'])) { |
|
| 73 | + $data['post_content'] = preg_replace($pattern, '$2', $data['post_content'], - 1, $count); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | return $data; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | -add_filter( 'wp_insert_post_data', 'wl_remove_text_annotations', '98', 1 ); |
|
| 79 | +add_filter('wp_insert_post_data', 'wl_remove_text_annotations', '98', 1); |
|
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * Adds wl-metabox CSS class to a metabox. |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @return array The updated list of CSS classes. |
| 87 | 87 | * @since 3.2.0 |
| 88 | 88 | */ |
| 89 | -function wl_admin_metaboxes_add_css_class( $classes = array() ) { |
|
| 89 | +function wl_admin_metaboxes_add_css_class($classes = array()) { |
|
| 90 | 90 | |
| 91 | - return array_merge( $classes, array( 'wl-metabox' ) ); |
|
| 91 | + return array_merge($classes, array('wl-metabox')); |
|
| 92 | 92 | } |
@@ -17,43 +17,43 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | class Wordlift_Admin_Schemaorg_Taxonomy_Metabox { |
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Render the metabox. |
|
| 22 | - * |
|
| 23 | - * @since 3.20.0 |
|
| 24 | - */ |
|
| 25 | - public static function render() { |
|
| 20 | + /** |
|
| 21 | + * Render the metabox. |
|
| 22 | + * |
|
| 23 | + * @since 3.20.0 |
|
| 24 | + */ |
|
| 25 | + public static function render() { |
|
| 26 | 26 | |
| 27 | - self::post_categories_meta_box( |
|
| 28 | - get_post(), |
|
| 29 | - array( |
|
| 30 | - 'args' => |
|
| 31 | - array( 'taxonomy' => Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME ), |
|
| 32 | - ) |
|
| 33 | - ); |
|
| 27 | + self::post_categories_meta_box( |
|
| 28 | + get_post(), |
|
| 29 | + array( |
|
| 30 | + 'args' => |
|
| 31 | + array( 'taxonomy' => Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME ), |
|
| 32 | + ) |
|
| 33 | + ); |
|
| 34 | 34 | |
| 35 | - } |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * A function which resembles WordPress' own to display a metabox, but which customizes the output |
|
| 39 | - * to display the Schema.org classes tree. |
|
| 40 | - * |
|
| 41 | - * @param WP_Post $post The {@link WP_Post} being edited. |
|
| 42 | - * @param array $box An array of arguments. |
|
| 43 | - * |
|
| 44 | - * @since 3.20.0 |
|
| 45 | - */ |
|
| 46 | - private static function post_categories_meta_box( $post, $box ) { |
|
| 47 | - $defaults = array( 'taxonomy' => 'category' ); |
|
| 48 | - if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) { |
|
| 49 | - $args = array(); |
|
| 50 | - } else { |
|
| 51 | - $args = $box['args']; |
|
| 52 | - } |
|
| 53 | - $r = wp_parse_args( $args, $defaults ); |
|
| 54 | - $tax_name = esc_attr( $r['taxonomy'] ); |
|
| 55 | - $taxonomy = get_taxonomy( $r['taxonomy'] ); |
|
| 56 | - ?> |
|
| 37 | + /** |
|
| 38 | + * A function which resembles WordPress' own to display a metabox, but which customizes the output |
|
| 39 | + * to display the Schema.org classes tree. |
|
| 40 | + * |
|
| 41 | + * @param WP_Post $post The {@link WP_Post} being edited. |
|
| 42 | + * @param array $box An array of arguments. |
|
| 43 | + * |
|
| 44 | + * @since 3.20.0 |
|
| 45 | + */ |
|
| 46 | + private static function post_categories_meta_box( $post, $box ) { |
|
| 47 | + $defaults = array( 'taxonomy' => 'category' ); |
|
| 48 | + if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) { |
|
| 49 | + $args = array(); |
|
| 50 | + } else { |
|
| 51 | + $args = $box['args']; |
|
| 52 | + } |
|
| 53 | + $r = wp_parse_args( $args, $defaults ); |
|
| 54 | + $tax_name = esc_attr( $r['taxonomy'] ); |
|
| 55 | + $taxonomy = get_taxonomy( $r['taxonomy'] ); |
|
| 56 | + ?> |
|
| 57 | 57 | <div id="taxonomy-<?php echo esc_attr( $tax_name ); ?>" class="categorydiv"> |
| 58 | 58 | <ul id="<?php echo esc_attr( $tax_name ); ?>-tabs" class="category-tabs"> |
| 59 | 59 | <li class="tabs"><a |
@@ -79,34 +79,34 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | <div id="<?php echo esc_attr( $tax_name ); ?>-legacy" class="tabs-panel" style="display: none;"> |
| 81 | 81 | <?php |
| 82 | - $name = ( 'category' === $tax_name ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; |
|
| 83 | - echo wp_kses( |
|
| 84 | - sprintf( |
|
| 85 | - "<input type='hidden' name='%s[]' value='0' />", |
|
| 86 | - esc_attr( $name ) |
|
| 87 | - ), |
|
| 88 | - array( |
|
| 89 | - 'input' => |
|
| 90 | - array( |
|
| 91 | - 'type' => array(), |
|
| 92 | - 'name' => array(), |
|
| 93 | - 'value' => array(), |
|
| 94 | - ), |
|
| 95 | - ) |
|
| 96 | - ); // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
|
| 97 | - ?> |
|
| 82 | + $name = ( 'category' === $tax_name ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; |
|
| 83 | + echo wp_kses( |
|
| 84 | + sprintf( |
|
| 85 | + "<input type='hidden' name='%s[]' value='0' />", |
|
| 86 | + esc_attr( $name ) |
|
| 87 | + ), |
|
| 88 | + array( |
|
| 89 | + 'input' => |
|
| 90 | + array( |
|
| 91 | + 'type' => array(), |
|
| 92 | + 'name' => array(), |
|
| 93 | + 'value' => array(), |
|
| 94 | + ), |
|
| 95 | + ) |
|
| 96 | + ); // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
|
| 97 | + ?> |
|
| 98 | 98 | <ul id="<?php echo esc_attr( $tax_name ); ?>checklist" |
| 99 | 99 | data-wp-lists="list:<?php echo esc_attr( $tax_name ); ?>" |
| 100 | 100 | class="categorychecklist form-no-clear"> |
| 101 | 101 | <?php |
| 102 | - wp_terms_checklist( |
|
| 103 | - $post->ID, |
|
| 104 | - array( |
|
| 105 | - 'taxonomy' => $tax_name, |
|
| 106 | - 'popular_cats' => $popular_ids, |
|
| 107 | - ) |
|
| 108 | - ); |
|
| 109 | - ?> |
|
| 102 | + wp_terms_checklist( |
|
| 103 | + $post->ID, |
|
| 104 | + array( |
|
| 105 | + 'taxonomy' => $tax_name, |
|
| 106 | + 'popular_cats' => $popular_ids, |
|
| 107 | + ) |
|
| 108 | + ); |
|
| 109 | + ?> |
|
| 110 | 110 | </ul> |
| 111 | 111 | </div> |
| 112 | 112 | <?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
@@ -115,9 +115,9 @@ discard block |
||
| 115 | 115 | href="#<?php echo esc_attr( $tax_name ); ?>-add" |
| 116 | 116 | class="taxonomy-add-new"> |
| 117 | 117 | <?php |
| 118 | - /* translators: %s: add new taxonomy label */ |
|
| 119 | - echo esc_html( sprintf( __( '+ %s', 'default' ), $taxonomy->labels->add_new_item ) ); |
|
| 120 | - ?> |
|
| 118 | + /* translators: %s: add new taxonomy label */ |
|
| 119 | + echo esc_html( sprintf( __( '+ %s', 'default' ), $taxonomy->labels->add_new_item ) ); |
|
| 120 | + ?> |
|
| 121 | 121 | </a> |
| 122 | 122 | <p id="<?php echo esc_attr( $tax_name ); ?>-add" class="category-add wp-hidden-child"> |
| 123 | 123 | <label class="screen-reader-text" |
@@ -131,42 +131,42 @@ discard block |
||
| 131 | 131 | <?php echo esc_html( $taxonomy->labels->parent_item_colon ); ?> |
| 132 | 132 | </label> |
| 133 | 133 | <?php |
| 134 | - $parent_dropdown_args = array( |
|
| 135 | - 'taxonomy' => $tax_name, |
|
| 136 | - 'hide_empty' => 0, |
|
| 137 | - 'name' => 'new' . $tax_name . '_parent', |
|
| 138 | - 'orderby' => 'name', |
|
| 139 | - 'hierarchical' => 1, |
|
| 140 | - 'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —', |
|
| 141 | - ); |
|
| 134 | + $parent_dropdown_args = array( |
|
| 135 | + 'taxonomy' => $tax_name, |
|
| 136 | + 'hide_empty' => 0, |
|
| 137 | + 'name' => 'new' . $tax_name . '_parent', |
|
| 138 | + 'orderby' => 'name', |
|
| 139 | + 'hierarchical' => 1, |
|
| 140 | + 'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —', |
|
| 141 | + ); |
|
| 142 | 142 | |
| 143 | - /** |
|
| 144 | - * Filters the arguments for the taxonomy parent dropdown on the Post Edit page. |
|
| 145 | - * |
|
| 146 | - * @param array $parent_dropdown_args { |
|
| 147 | - * Optional. Array of arguments to generate parent dropdown. |
|
| 148 | - * |
|
| 149 | - * @type string $taxonomy Name of the taxonomy to retrieve. |
|
| 150 | - * @type bool $hide_if_empty True to skip generating markup if no |
|
| 151 | - * categories are found. Default 0. |
|
| 152 | - * @type string $name Value for the 'name' attribute |
|
| 153 | - * of the select element. |
|
| 154 | - * Default "new{$tax_name}_parent". |
|
| 155 | - * @type string $orderby Which column to use for ordering |
|
| 156 | - * terms. Default 'name'. |
|
| 157 | - * @type bool|int $hierarchical Whether to traverse the taxonomy |
|
| 158 | - * hierarchy. Default 1. |
|
| 159 | - * @type string $show_option_none Text to display for the "none" option. |
|
| 160 | - * Default "— {$parent} —", |
|
| 161 | - * where `$parent` is 'parent_item' |
|
| 162 | - * taxonomy label. |
|
| 163 | - * } |
|
| 164 | - * @since 4.4.0 |
|
| 165 | - */ |
|
| 166 | - $parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args ); |
|
| 143 | + /** |
|
| 144 | + * Filters the arguments for the taxonomy parent dropdown on the Post Edit page. |
|
| 145 | + * |
|
| 146 | + * @param array $parent_dropdown_args { |
|
| 147 | + * Optional. Array of arguments to generate parent dropdown. |
|
| 148 | + * |
|
| 149 | + * @type string $taxonomy Name of the taxonomy to retrieve. |
|
| 150 | + * @type bool $hide_if_empty True to skip generating markup if no |
|
| 151 | + * categories are found. Default 0. |
|
| 152 | + * @type string $name Value for the 'name' attribute |
|
| 153 | + * of the select element. |
|
| 154 | + * Default "new{$tax_name}_parent". |
|
| 155 | + * @type string $orderby Which column to use for ordering |
|
| 156 | + * terms. Default 'name'. |
|
| 157 | + * @type bool|int $hierarchical Whether to traverse the taxonomy |
|
| 158 | + * hierarchy. Default 1. |
|
| 159 | + * @type string $show_option_none Text to display for the "none" option. |
|
| 160 | + * Default "— {$parent} —", |
|
| 161 | + * where `$parent` is 'parent_item' |
|
| 162 | + * taxonomy label. |
|
| 163 | + * } |
|
| 164 | + * @since 4.4.0 |
|
| 165 | + */ |
|
| 166 | + $parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args ); |
|
| 167 | 167 | |
| 168 | - wp_dropdown_categories( $parent_dropdown_args ); |
|
| 169 | - ?> |
|
| 168 | + wp_dropdown_categories( $parent_dropdown_args ); |
|
| 169 | + ?> |
|
| 170 | 170 | <input type="button" id="<?php echo esc_attr( $tax_name ); ?>-add-submit" |
| 171 | 171 | data-wp-lists="add:<?php echo esc_html( $tax_name ); ?>checklist:<?php echo esc_attr( $tax_name ); ?>-add" |
| 172 | 172 | class="button category-add-submit" |
@@ -178,6 +178,6 @@ discard block |
||
| 178 | 178 | <?php endif; ?> |
| 179 | 179 | </div> |
| 180 | 180 | <?php |
| 181 | - } |
|
| 181 | + } |
|
| 182 | 182 | |
| 183 | 183 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | get_post(), |
| 29 | 29 | array( |
| 30 | 30 | 'args' => |
| 31 | - array( 'taxonomy' => Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME ), |
|
| 31 | + array('taxonomy' => Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME), |
|
| 32 | 32 | ) |
| 33 | 33 | ); |
| 34 | 34 | |
@@ -43,47 +43,47 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @since 3.20.0 |
| 45 | 45 | */ |
| 46 | - private static function post_categories_meta_box( $post, $box ) { |
|
| 47 | - $defaults = array( 'taxonomy' => 'category' ); |
|
| 48 | - if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) { |
|
| 46 | + private static function post_categories_meta_box($post, $box) { |
|
| 47 | + $defaults = array('taxonomy' => 'category'); |
|
| 48 | + if ( ! isset($box['args']) || ! is_array($box['args'])) { |
|
| 49 | 49 | $args = array(); |
| 50 | 50 | } else { |
| 51 | 51 | $args = $box['args']; |
| 52 | 52 | } |
| 53 | - $r = wp_parse_args( $args, $defaults ); |
|
| 54 | - $tax_name = esc_attr( $r['taxonomy'] ); |
|
| 55 | - $taxonomy = get_taxonomy( $r['taxonomy'] ); |
|
| 53 | + $r = wp_parse_args($args, $defaults); |
|
| 54 | + $tax_name = esc_attr($r['taxonomy']); |
|
| 55 | + $taxonomy = get_taxonomy($r['taxonomy']); |
|
| 56 | 56 | ?> |
| 57 | - <div id="taxonomy-<?php echo esc_attr( $tax_name ); ?>" class="categorydiv"> |
|
| 58 | - <ul id="<?php echo esc_attr( $tax_name ); ?>-tabs" class="category-tabs"> |
|
| 57 | + <div id="taxonomy-<?php echo esc_attr($tax_name); ?>" class="categorydiv"> |
|
| 58 | + <ul id="<?php echo esc_attr($tax_name); ?>-tabs" class="category-tabs"> |
|
| 59 | 59 | <li class="tabs"><a |
| 60 | - href="#<?php echo esc_attr( $tax_name ); ?>-all"><?php echo esc_html( $taxonomy->labels->all_items ); ?></a> |
|
| 60 | + href="#<?php echo esc_attr($tax_name); ?>-all"><?php echo esc_html($taxonomy->labels->all_items); ?></a> |
|
| 61 | 61 | </li> |
| 62 | 62 | <li> |
| 63 | - <a href="#<?php echo esc_attr( $tax_name ); ?>-pop"><?php echo esc_html__( 'Most Used', 'wordlift' ); ?></a> |
|
| 63 | + <a href="#<?php echo esc_attr($tax_name); ?>-pop"><?php echo esc_html__('Most Used', 'wordlift'); ?></a> |
|
| 64 | 64 | </li> |
| 65 | - <li><a href="#<?php echo esc_attr( $tax_name ); ?>-legacy"> |
|
| 66 | - <?php echo esc_html_x( 'A-Z', 'Entity Types metabox', 'wordlift' ); ?></a> |
|
| 65 | + <li><a href="#<?php echo esc_attr($tax_name); ?>-legacy"> |
|
| 66 | + <?php echo esc_html_x('A-Z', 'Entity Types metabox', 'wordlift'); ?></a> |
|
| 67 | 67 | </li> |
| 68 | 68 | </ul> |
| 69 | 69 | |
| 70 | - <div id="<?php echo esc_attr( $tax_name ); ?>-all" class="tabs-panel"> |
|
| 70 | + <div id="<?php echo esc_attr($tax_name); ?>-all" class="tabs-panel"> |
|
| 71 | 71 | <div id="wl-schema-class-tree"></div> |
| 72 | 72 | </div> |
| 73 | 73 | |
| 74 | - <div id="<?php echo esc_attr( $tax_name ); ?>-pop" class="tabs-panel" style="display: none;"> |
|
| 75 | - <ul id="<?php echo esc_attr( $tax_name ); ?>checklist-pop" class="categorychecklist form-no-clear"> |
|
| 76 | - <?php $popular_ids = wp_popular_terms_checklist( $tax_name ); ?> |
|
| 74 | + <div id="<?php echo esc_attr($tax_name); ?>-pop" class="tabs-panel" style="display: none;"> |
|
| 75 | + <ul id="<?php echo esc_attr($tax_name); ?>checklist-pop" class="categorychecklist form-no-clear"> |
|
| 76 | + <?php $popular_ids = wp_popular_terms_checklist($tax_name); ?> |
|
| 77 | 77 | </ul> |
| 78 | 78 | </div> |
| 79 | 79 | |
| 80 | - <div id="<?php echo esc_attr( $tax_name ); ?>-legacy" class="tabs-panel" style="display: none;"> |
|
| 80 | + <div id="<?php echo esc_attr($tax_name); ?>-legacy" class="tabs-panel" style="display: none;"> |
|
| 81 | 81 | <?php |
| 82 | - $name = ( 'category' === $tax_name ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; |
|
| 82 | + $name = ('category' === $tax_name) ? 'post_category' : 'tax_input['.$tax_name.']'; |
|
| 83 | 83 | echo wp_kses( |
| 84 | 84 | sprintf( |
| 85 | 85 | "<input type='hidden' name='%s[]' value='0' />", |
| 86 | - esc_attr( $name ) |
|
| 86 | + esc_attr($name) |
|
| 87 | 87 | ), |
| 88 | 88 | array( |
| 89 | 89 | 'input' => |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | ) |
| 96 | 96 | ); // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
| 97 | 97 | ?> |
| 98 | - <ul id="<?php echo esc_attr( $tax_name ); ?>checklist" |
|
| 99 | - data-wp-lists="list:<?php echo esc_attr( $tax_name ); ?>" |
|
| 98 | + <ul id="<?php echo esc_attr($tax_name); ?>checklist" |
|
| 99 | + data-wp-lists="list:<?php echo esc_attr($tax_name); ?>" |
|
| 100 | 100 | class="categorychecklist form-no-clear"> |
| 101 | 101 | <?php |
| 102 | 102 | wp_terms_checklist( |
@@ -109,35 +109,35 @@ discard block |
||
| 109 | 109 | ?> |
| 110 | 110 | </ul> |
| 111 | 111 | </div> |
| 112 | - <?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
|
| 113 | - <div id="<?php echo esc_attr( $tax_name ); ?>-adder" class="wp-hidden-children"> |
|
| 114 | - <a id="<?php echo esc_attr( $tax_name ); ?>-add-toggle" |
|
| 115 | - href="#<?php echo esc_attr( $tax_name ); ?>-add" |
|
| 112 | + <?php if (current_user_can($taxonomy->cap->edit_terms)) : ?> |
|
| 113 | + <div id="<?php echo esc_attr($tax_name); ?>-adder" class="wp-hidden-children"> |
|
| 114 | + <a id="<?php echo esc_attr($tax_name); ?>-add-toggle" |
|
| 115 | + href="#<?php echo esc_attr($tax_name); ?>-add" |
|
| 116 | 116 | class="taxonomy-add-new"> |
| 117 | 117 | <?php |
| 118 | 118 | /* translators: %s: add new taxonomy label */ |
| 119 | - echo esc_html( sprintf( __( '+ %s', 'default' ), $taxonomy->labels->add_new_item ) ); |
|
| 119 | + echo esc_html(sprintf(__('+ %s', 'default'), $taxonomy->labels->add_new_item)); |
|
| 120 | 120 | ?> |
| 121 | 121 | </a> |
| 122 | - <p id="<?php echo esc_attr( $tax_name ); ?>-add" class="category-add wp-hidden-child"> |
|
| 122 | + <p id="<?php echo esc_attr($tax_name); ?>-add" class="category-add wp-hidden-child"> |
|
| 123 | 123 | <label class="screen-reader-text" |
| 124 | - for="new<?php echo esc_attr( $tax_name ); ?>"><?php echo esc_html( $taxonomy->labels->add_new_item ); ?></label> |
|
| 125 | - <input type="text" name="new<?php echo esc_html( $tax_name ); ?>" |
|
| 126 | - id="new<?php echo esc_attr( $tax_name ); ?>" |
|
| 124 | + for="new<?php echo esc_attr($tax_name); ?>"><?php echo esc_html($taxonomy->labels->add_new_item); ?></label> |
|
| 125 | + <input type="text" name="new<?php echo esc_html($tax_name); ?>" |
|
| 126 | + id="new<?php echo esc_attr($tax_name); ?>" |
|
| 127 | 127 | class="form-required form-input-tip" |
| 128 | - value="<?php echo esc_attr( $taxonomy->labels->new_item_name ); ?>" |
|
| 128 | + value="<?php echo esc_attr($taxonomy->labels->new_item_name); ?>" |
|
| 129 | 129 | aria-required="true"/> |
| 130 | - <label class="screen-reader-text" for="new<?php echo esc_attr( $tax_name ); ?>_parent"> |
|
| 131 | - <?php echo esc_html( $taxonomy->labels->parent_item_colon ); ?> |
|
| 130 | + <label class="screen-reader-text" for="new<?php echo esc_attr($tax_name); ?>_parent"> |
|
| 131 | + <?php echo esc_html($taxonomy->labels->parent_item_colon); ?> |
|
| 132 | 132 | </label> |
| 133 | 133 | <?php |
| 134 | 134 | $parent_dropdown_args = array( |
| 135 | 135 | 'taxonomy' => $tax_name, |
| 136 | 136 | 'hide_empty' => 0, |
| 137 | - 'name' => 'new' . $tax_name . '_parent', |
|
| 137 | + 'name' => 'new'.$tax_name.'_parent', |
|
| 138 | 138 | 'orderby' => 'name', |
| 139 | 139 | 'hierarchical' => 1, |
| 140 | - 'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —', |
|
| 140 | + 'show_option_none' => '— '.$taxonomy->labels->parent_item.' —', |
|
| 141 | 141 | ); |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -163,16 +163,16 @@ discard block |
||
| 163 | 163 | * } |
| 164 | 164 | * @since 4.4.0 |
| 165 | 165 | */ |
| 166 | - $parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args ); |
|
| 166 | + $parent_dropdown_args = apply_filters('post_edit_category_parent_dropdown_args', $parent_dropdown_args); |
|
| 167 | 167 | |
| 168 | - wp_dropdown_categories( $parent_dropdown_args ); |
|
| 168 | + wp_dropdown_categories($parent_dropdown_args); |
|
| 169 | 169 | ?> |
| 170 | - <input type="button" id="<?php echo esc_attr( $tax_name ); ?>-add-submit" |
|
| 171 | - data-wp-lists="add:<?php echo esc_html( $tax_name ); ?>checklist:<?php echo esc_attr( $tax_name ); ?>-add" |
|
| 170 | + <input type="button" id="<?php echo esc_attr($tax_name); ?>-add-submit" |
|
| 171 | + data-wp-lists="add:<?php echo esc_html($tax_name); ?>checklist:<?php echo esc_attr($tax_name); ?>-add" |
|
| 172 | 172 | class="button category-add-submit" |
| 173 | - value="<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>"/> |
|
| 174 | - <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?> |
|
| 175 | - <span id="<?php echo esc_attr( $tax_name ); ?>-ajax-response"></span> |
|
| 173 | + value="<?php echo esc_attr($taxonomy->labels->add_new_item); ?>"/> |
|
| 174 | + <?php wp_nonce_field('add-'.$tax_name, '_ajax_nonce-add-'.$tax_name, false); ?> |
|
| 175 | + <span id="<?php echo esc_attr($tax_name); ?>-ajax-response"></span> |
|
| 176 | 176 | </p> |
| 177 | 177 | </div> |
| 178 | 178 | <?php endif; ?> |