Changeset 1880126
- Timestamp:
- 05/23/2018 02:36:12 PM (8 years ago)
- Location:
- yumjam-masonry-layout-for-posts-and-custom-post-types/trunk
- Files:
-
- 3 edited
-
class/masonry_custom_cpt.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
-
yumjam_masonry.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
yumjam-masonry-layout-for-posts-and-custom-post-types/trunk/class/masonry_custom_cpt.php
r1866847 r1880126 409 409 $meta = array( 410 410 //('input type', 'name/id', 'placeholder text', 'Label text', 'value') 411 'enabled' => array('checkbox', 'enabled', '', 'Show in Masonry', 'on'), 411 'enabled' => array('checkbox', 'enabled', '', 'Customise Styling', 'on'), 412 'do_not_show' => array('checkbox', 'do_not_show', '', 'Do not Show in Masonry', 'off'), 412 413 'columns' => array('select', 'columns', '0', 'Columns to span', $this->col_val), 413 414 'header_label' => array('group', '', '', 'Masonry header options', ''), … … 451 452 global $post; 452 453 $enabled = get_post_meta($post->ID, 'custom_enabled', true); 454 $do_not_show = get_post_meta($post->ID, 'custom_do_not_show', true); 453 455 ob_start(); 454 456 ?> … … 457 459 <div class="masonry-col-sm-13 "> 458 460 <p class="form-field yj-cpt-input"> 459 <label for="enabled">Show in Masonry</label> 461 <label for="do_not_show">Do not Show in Masonry</label> 462 <input class="short" type="checkbox" id="custom_do_not_show" name="custom_do_not_show" <?php if ($do_not_show == 'on') { echo ' checked="true"'; }; ?> > 463 <label for="enabled">Customise Styling</label> 460 464 <input class="short" type="checkbox" id="custom_enabled" name="custom_enabled" <?php if ($enabled == 'on') { echo ' checked="true"'; }; ?> > 461 465 </p> … … 466 470 <?php 467 471 foreach ($meta as $id => $i) { 468 if ($id != 'enabled') { 469 echo $this->input_box($i[0], $i[1], $i[2], $i[3], empty($i[4])?'':$i[4], empty($i[5])?'':$i[5], empty($i[6])?'':$i[6]); 472 if ($id == 'enabled' || $id == 'do_not_show') { 473 //Skip these in meta box 474 } else { 475 echo $this->input_box($i[0], $i[1], $i[2], $i[3], empty($i[4])?'':$i[4], empty($i[5])?'':$i[5], empty($i[6])?'':$i[6]); 470 476 } 471 477 } … … 562 568 563 569 if (empty($post_data['custom_enabled'])) { 564 update_post_meta($post_id, 'custom_enabled', 'o n');570 update_post_meta($post_id, 'custom_enabled', 'off'); 565 571 } else { 566 572 update_post_meta($post_id, 'custom_enabled', $post_data['custom_enabled']); 567 573 } 574 575 if (empty($post_data['custom_do_not_show'])) { 576 update_post_meta($post_id, 'custom_do_not_show', 'off'); 577 } else { 578 update_post_meta($post_id, 'custom_do_not_show', $post_data['custom_do_not_show']); 579 } 568 580 569 581 if (in_array($post->post_type, $this->supported_post_types) && !empty($post_data)) { -
yumjam-masonry-layout-for-posts-and-custom-post-types/trunk/readme.txt
r1866847 r1880126 50 50 == Changelog == 51 51 52 = 0.8.7 = 53 * Add "do not show" in masonry checkbox in post metabox 54 * Add custom styling checkbox in post metabox 55 52 56 = 0.8.6 = 53 57 * Add general settings to enable/disabled some supported post types -
yumjam-masonry-layout-for-posts-and-custom-post-types/trunk/yumjam_masonry.php
r1866847 r1880126 13 13 * Plugin URI: https://www.yumjam.co.uk/yumjam-wordpress-plugins/wp-masonry-plugin/ 14 14 * Description: Easily display Wordpress posts or custom post type entries within a tidy masonry style wall layout. 15 * Version: 0.8. 615 * Version: 0.8.7 16 16 * Author: YumJam 17 17 * Author URI: https://www.yumjam.co.uk … … 21 21 * Tags: masonry, wall, post display, brick layout, wall layout, blog layout, shortcode, pintrest, news layout, lazy loading, ajax loading 22 22 * Requires at least: 4.0 23 * Tested up to: 4.9. 524 * Stable tag: 4.9. 523 * Tested up to: 4.9.6 24 * Stable tag: 4.9.6 25 25 */ 26 26 if (!defined('ABSPATH')) { … … 420 420 421 421 function manage_custom_posts_columns($columns) { 422 $columns['custom_ enabled'] = esc_html__('Enabledin Masonry');422 $columns['custom_do_not_show'] = esc_html__('Hide in Masonry'); 423 423 return $columns; 424 424 } 425 425 426 426 function remove_dummy_column($columns){ 427 unset($columns['custom_ enabled']);427 unset($columns['custom_do_not_show']); 428 428 return $columns; 429 429 } 430 430 431 431 function on_bulk_edit_custom_box($column_name, $post_type){ 432 if ('custom_ enabled' == $column_name) {433 echo esc_html__(' Enabledin Masonry');432 if ('custom_do_not_show' == $column_name) { 433 echo esc_html__('Hide in Masonry'); 434 434 } 435 435 } … … 623 623 //if (!empty($atts[$key])) { 624 624 if (!empty($atts[$key]) || ($atts["block_spacing"]=="0" && $key=="block_spacing")) { 625 626 625 $this->options[$key] = $atts[$key]; 627 626 } … … 634 633 'posts_per_page' => $this->options['default_per_page'], 635 634 'paged' => empty($atts['paged']) ? '' : ($atts['paged']), 636 'meta_query' => array( 635 ); 636 637 //Ignore the show hide check box if wp meta box is disabled 638 if (get_option('yjm_disable_post_metabox') != 1) { 639 $args['meta_query'] = array( 640 'relation' => 'OR', 637 641 array( 638 'key' => 'custom_ enabled',642 'key' => 'custom_do_not_show', 639 643 'value' => 'off', 640 'compare' => '!=' 641 ) 642 ) 643 ); 644 'compare' => '==' 645 ), 646 array( 647 'key' => 'custom_do_not_show', 648 'compare' => 'NOT EXISTS', 649 'value' => '' 650 ) 651 ); 652 } 644 653 645 654 if (!empty($this->options['post_cats']) && $this->options['post_cats'] != 'all') {
Note: See TracChangeset
for help on using the changeset viewer.