PluginProbe
Boxzilla – WordPress Popup Builder / 3.2.4
Boxzilla – WordPress Popup Builder v3.2.4
3.4.11 3.4.10 3.4.9 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 trunk 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 All 72 releases
← All changes | src/admin/class-admin.php +14 -17 3.1.143.2.4 View file →
@@ -155,10 +155,11 @@
155 155 * @param $column
156 156 * @param $post_id
157 157 */
158 158 public function post_type_column_content( $column, $post_id ) {
159 - if ( method_exists( $this, 'post_type_column_' . $column . '_content' ) ) {
160 - call_user_func( array( $this, 'post_type_column_' . $column . '_content' ), $post_id );
159 + $method_name = 'post_type_column_' . $column . '_content';
160 + if ( method_exists( $this, $method_name ) ) {
161 + call_user_func( array( $this, $method_name ), $post_id );
161 162 }
162 163 }
163 164
164 165 /**
@@ -292,9 +293,8 @@
292 293 return false;
293 294 }
294 295
295 296 if ( $screen->base === 'edit' && $screen->post_type === 'boxzilla-box' ) {
296 - // load stylesheets
297 297 wp_enqueue_style( 'boxzilla-admin' );
298 298 }
299 299
300 300 if ( $screen->base === 'post' && $screen->post_type === 'boxzilla-box' ) {
@@ -303,16 +303,16 @@
303 303
304 304 // load scripts
305 305 wp_enqueue_script( 'boxzilla-admin' );
306 306
307 - wp_localize_script( 'boxzilla-admin' ,'boxzilla_i18n', array(
308 - 'enterCommaSeparatedValues' => __( 'Enter a comma-separated list of values.', 'boxzilla' ),
309 - 'enterCommaSeparatedPosts' => __( "Enter a comma-separated list of post slugs or post ID's..", 'boxzilla' ),
310 - 'enterCommaSeparatedPages' => __( "Enter a comma-separated list of page slugs or page ID's..", 'boxzilla' ),
311 - 'enterCommaSeparatedPostTypes' => __( "Enter a comma-separated list of post types..", 'boxzilla' ),
312 - 'enterCommaSeparatedRelativeUrls' => __( "Enter a comma-separated list of relative URL's, eg /contact/", 'boxzilla' ),
313 - )
307 + $data = array(
308 + 'enterCommaSeparatedValues' => __( 'Enter a comma-separated list of values.', 'boxzilla' ),
309 + 'enterCommaSeparatedPosts' => __( "Enter a comma-separated list of post slugs or post ID's..", 'boxzilla' ),
310 + 'enterCommaSeparatedPages' => __( "Enter a comma-separated list of page slugs or page ID's..", 'boxzilla' ),
311 + 'enterCommaSeparatedPostTypes' => __( "Enter a comma-separated list of post types..", 'boxzilla' ),
312 + 'enterCommaSeparatedRelativeUrls' => __( "Enter a comma-separated list of relative URL's, eg /contact/", 'boxzilla' ),
314 313 );
314 + wp_localize_script( 'boxzilla-admin' ,'boxzilla_i18n', $data );
315 315
316 316 // load stylesheets
317 317 wp_enqueue_style( 'boxzilla-admin' );
318 318
@@ -320,9 +320,8 @@
320 320 do_action( 'boxzilla_load_admin_assets' );
321 321 }
322 322
323 323 if ( isset( $_GET['page'] ) && $_GET['page'] === 'boxzilla-settings' ) {
324 - // load stylesheets
325 324 wp_enqueue_style( 'boxzilla-admin' );
326 325 }
327 326
328 327 }
@@ -509,9 +508,9 @@
509 508 $url_string = parse_url( $url_string, PHP_URL_PATH );
510 509 }
511 510
512 511 // leading slash it
513 - return '/' . ltrim( $url_string, '/' );
512 + return $url_string;
514 513 }
515 514
516 515 /**
517 516 * @param array $rule
@@ -541,10 +540,8 @@
541 540 if ( is_array( $rule['value'] ) ) {
542 541 $rule['value'] = join( ',', $rule['value'] );
543 542 }
544 543
545 - $rule['qualifier'] = isset( $rule['qualifier'] ) && ! $rule['qualifier'] ? 0 : 1;
546 -
547 544 return $rule;
548 545 }
549 546
550 547 /**
@@ -614,9 +611,9 @@
614 611 *
615 612 * @return array
616 613 */
617 614 public function add_plugin_settings_link( $links, $slug ) {
618 - if ( $slug !== $this->plugin->slug() ) {
615 + if ( $slug !== $this->plugin->slug() || ! is_array( $links ) ) {
619 616 return $links;
620 617 }
621 618
622 619 $settings_link = '<a href="' . admin_url( 'edit.php?post_type=boxzilla-box' ) . '">' . __( 'Boxes' ) . '</a>';
@@ -654,9 +651,9 @@
654 651 public function flush_rules( $post_id ) {
655 652
656 653 // only act on our own post type
657 654 $post = get_post( $post_id );
658 - if ( $post instanceof WP_Post && $post->post_type !== 'boxzilla-box' ) {
655 + if ( ! $post instanceof WP_Post || $post->post_type !== 'boxzilla-box' ) {
659 656 return;
660 657 }
661 658
662 659 // get all published boxes
@@ -709,9 +706,9 @@
709 706 $response = wp_remote_retrieve_body( $request );
710 707 $response = json_decode( $response );
711 708
712 709 if ( is_array( $response->data ) ) {
713 - set_transient( 'boxzilla_remote_extensions', $response->data, HOUR_IN_SECONDS );
710 + set_transient( 'boxzilla_remote_extensions', $response->data, 24 * HOUR_IN_SECONDS );
714 711
715 712 return $response->data;
716 713 }
717 714