Changeset 3269009
- Timestamp:
- 04/08/2025 03:11:54 PM (12 months ago)
- Location:
- taro-ad-fields
- Files:
-
- 8 edited
- 1 copied
-
tags/1.3.4 (copied) (copied from taro-ad-fields/trunk)
-
tags/1.3.4/includes/context.php (modified) (1 diff)
-
tags/1.3.4/readme.txt (modified) (1 diff)
-
tags/1.3.4/taro-ad-fields.php (modified) (1 diff)
-
tags/1.3.4/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/includes/context.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/taro-ad-fields.php (modified) (1 diff)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
taro-ad-fields/tags/1.3.4/includes/context.php
r3268298 r3269009 24 24 'new_item_name' => __( 'New Context', 'taf' ), 25 25 ), 26 'public' => false, 27 'show_ui' => true, 26 28 'show_admin_column' => true, 27 29 'hierarchical' => true, 28 'meta_box_cb' => function ( $post ) { 29 $terms = get_the_terms( $post, 'ad-context' ); 30 $selected = array(); 31 if ( is_array( $terms ) && ! is_wp_error( $terms ) ) { 32 foreach ( $terms as $term ) { 33 $selected[] = $term->term_id; 34 } 35 } 36 $all_parents = get_terms( 'ad-context', array( 37 'hide_empty' => false, 38 'parent' => 0, // Only parents. 39 ) ); 40 if ( empty( $all_parents ) || is_wp_error( $all_parents ) ) { 41 // No parent found. 42 printf( '<p class="description">%s</p>', esc_html__( 'No context found.', 'taf' ) ); 43 return; 44 } 45 foreach ( $all_parents as $parent ) { 46 $children = get_terms( 'ad-context', array( 47 'hide_empty' => false, 48 'parent' => $parent->term_id, 49 ) ); 50 if ( empty( $children ) || is_wp_error( $children ) ) { 51 // No child found. 52 printf( '<p class="description">%s %s</p>', __( 'No item for the context:', 'taf' ), esc_html( $parent->name ) ); 53 continue; 54 } 55 echo '<div class="ad-context__container">'; 56 printf( '<h3 class="ad-context__heading">%s</h3>', esc_html( $parent->name ) ); 57 if ( trim( $parent->description ) ) { 58 // Description exists. 59 printf( '<p class="description">%s</p>', nl2br( esc_html( $parent->description ) ) ); 60 } 61 foreach ( $children as $child ) { 62 printf( 63 '<p class="ad-context__item"><label><input type="checkbox" name="tax_input[%s][]" value="%d" %s /> %s</label></p>', 64 esc_attr( $child->taxonomy ), 65 esc_attr( $child->term_id ), 66 checked( in_array( $child->term_id, $selected, true ), true, false ), 67 esc_html( $child->name ) 68 ); 69 } 70 echo '</div> <!-- //ad-context__container -->'; 71 } 72 ?> 73 <p class="ad-context__info"> 74 <?php esc_html_e( 'Context is defined by theme or plugin.', 'taf' ); ?> 75 </p> 76 <?php 77 }, 30 'meta_box_cb' => 'taf_context_meta_box_callback', 78 31 ) 79 32 ); 80 33 }, 11 ); 81 34 35 /** 36 * Render context meta box. 37 * 38 * @param WP_Post$post 39 * @return void 40 */ 41 function taf_context_meta_box_callback( $post ) { 42 $terms = get_the_terms( $post, 'ad-context' ); 43 $selected = array(); 44 if ( is_array( $terms ) && ! is_wp_error( $terms ) ) { 45 foreach ( $terms as $term ) { 46 $selected[] = $term->term_id; 47 } 48 } 49 $all_parents = get_terms( 'ad-context', array( 50 'hide_empty' => false, 51 'parent' => 0, // Only parents. 52 ) ); 53 if ( empty( $all_parents ) || is_wp_error( $all_parents ) ) { 54 // No parent found. 55 printf( '<p class="description">%s</p>', esc_html__( 'No context found.', 'taf' ) ); 56 return; 57 } 58 foreach ( $all_parents as $parent ) { 59 $children = get_terms( 'ad-context', array( 60 'hide_empty' => false, 61 'parent' => $parent->term_id, 62 ) ); 63 if ( empty( $children ) || is_wp_error( $children ) ) { 64 // No child found. 65 printf( '<p class="description">%s %s</p>', __( 'No item for the context:', 'taf' ), esc_html( $parent->name ) ); 66 continue; 67 } 68 echo '<div class="ad-context__container">'; 69 printf( '<h3 class="ad-context__heading">%s</h3>', esc_html( $parent->name ) ); 70 if ( trim( $parent->description ) ) { 71 // Description exists. 72 printf( '<p class="description">%s</p>', nl2br( esc_html( $parent->description ) ) ); 73 } 74 foreach ( $children as $child ) { 75 printf( 76 '<p class="ad-context__item"><label><input type="checkbox" name="tax_input[%s][]" value="%d" %s /> %s</label></p>', 77 esc_attr( $child->taxonomy ), 78 esc_attr( $child->term_id ), 79 checked( in_array( $child->term_id, $selected, true ), true, false ), 80 esc_html( $child->name ) 81 ); 82 } 83 echo '</div> <!-- //ad-context__container -->'; 84 } 85 ?> 86 <p class="ad-context__info"> 87 <?php esc_html_e( 'Context is defined by theme or plugin.', 'taf' ); ?> 88 </p> 89 <?php 90 } 82 91 83 92 /** -
taro-ad-fields/tags/1.3.4/readme.txt
r3268937 r3269009 3 3 Contributors: tarosky, Takahashi_Fumiki, yocchi161 4 4 Tags: advertisement 5 Stable tag: 1.3. 35 Stable tag: 1.3.4 6 6 License: GPLv3 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-3.0.txt -
taro-ad-fields/tags/1.3.4/taro-ad-fields.php
r3268937 r3269009 12 12 Domain Path: /languages/ 13 13 License: GPL v3 or later. 14 Version: 1.3. 314 Version: 1.3.4 15 15 */ 16 16 -
taro-ad-fields/tags/1.3.4/vendor/composer/installed.php
r3268937 r3269009 2 2 'root' => array( 3 3 'name' => 'tarosky/taro-ad-fields', 4 'pretty_version' => '1.3. 3',5 'version' => '1.3. 3.0',6 'reference' => ' cb322b1aca95dfbeb5103b10f2bc1d375f69ee3a',4 'pretty_version' => '1.3.4', 5 'version' => '1.3.4.0', 6 'reference' => 'ea743641a149109307d2d82868f312d595c38821', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'tarosky/taro-ad-fields' => array( 14 'pretty_version' => '1.3. 3',15 'version' => '1.3. 3.0',16 'reference' => ' cb322b1aca95dfbeb5103b10f2bc1d375f69ee3a',14 'pretty_version' => '1.3.4', 15 'version' => '1.3.4.0', 16 'reference' => 'ea743641a149109307d2d82868f312d595c38821', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
taro-ad-fields/trunk/includes/context.php
r3268298 r3269009 24 24 'new_item_name' => __( 'New Context', 'taf' ), 25 25 ), 26 'public' => false, 27 'show_ui' => true, 26 28 'show_admin_column' => true, 27 29 'hierarchical' => true, 28 'meta_box_cb' => function ( $post ) { 29 $terms = get_the_terms( $post, 'ad-context' ); 30 $selected = array(); 31 if ( is_array( $terms ) && ! is_wp_error( $terms ) ) { 32 foreach ( $terms as $term ) { 33 $selected[] = $term->term_id; 34 } 35 } 36 $all_parents = get_terms( 'ad-context', array( 37 'hide_empty' => false, 38 'parent' => 0, // Only parents. 39 ) ); 40 if ( empty( $all_parents ) || is_wp_error( $all_parents ) ) { 41 // No parent found. 42 printf( '<p class="description">%s</p>', esc_html__( 'No context found.', 'taf' ) ); 43 return; 44 } 45 foreach ( $all_parents as $parent ) { 46 $children = get_terms( 'ad-context', array( 47 'hide_empty' => false, 48 'parent' => $parent->term_id, 49 ) ); 50 if ( empty( $children ) || is_wp_error( $children ) ) { 51 // No child found. 52 printf( '<p class="description">%s %s</p>', __( 'No item for the context:', 'taf' ), esc_html( $parent->name ) ); 53 continue; 54 } 55 echo '<div class="ad-context__container">'; 56 printf( '<h3 class="ad-context__heading">%s</h3>', esc_html( $parent->name ) ); 57 if ( trim( $parent->description ) ) { 58 // Description exists. 59 printf( '<p class="description">%s</p>', nl2br( esc_html( $parent->description ) ) ); 60 } 61 foreach ( $children as $child ) { 62 printf( 63 '<p class="ad-context__item"><label><input type="checkbox" name="tax_input[%s][]" value="%d" %s /> %s</label></p>', 64 esc_attr( $child->taxonomy ), 65 esc_attr( $child->term_id ), 66 checked( in_array( $child->term_id, $selected, true ), true, false ), 67 esc_html( $child->name ) 68 ); 69 } 70 echo '</div> <!-- //ad-context__container -->'; 71 } 72 ?> 73 <p class="ad-context__info"> 74 <?php esc_html_e( 'Context is defined by theme or plugin.', 'taf' ); ?> 75 </p> 76 <?php 77 }, 30 'meta_box_cb' => 'taf_context_meta_box_callback', 78 31 ) 79 32 ); 80 33 }, 11 ); 81 34 35 /** 36 * Render context meta box. 37 * 38 * @param WP_Post$post 39 * @return void 40 */ 41 function taf_context_meta_box_callback( $post ) { 42 $terms = get_the_terms( $post, 'ad-context' ); 43 $selected = array(); 44 if ( is_array( $terms ) && ! is_wp_error( $terms ) ) { 45 foreach ( $terms as $term ) { 46 $selected[] = $term->term_id; 47 } 48 } 49 $all_parents = get_terms( 'ad-context', array( 50 'hide_empty' => false, 51 'parent' => 0, // Only parents. 52 ) ); 53 if ( empty( $all_parents ) || is_wp_error( $all_parents ) ) { 54 // No parent found. 55 printf( '<p class="description">%s</p>', esc_html__( 'No context found.', 'taf' ) ); 56 return; 57 } 58 foreach ( $all_parents as $parent ) { 59 $children = get_terms( 'ad-context', array( 60 'hide_empty' => false, 61 'parent' => $parent->term_id, 62 ) ); 63 if ( empty( $children ) || is_wp_error( $children ) ) { 64 // No child found. 65 printf( '<p class="description">%s %s</p>', __( 'No item for the context:', 'taf' ), esc_html( $parent->name ) ); 66 continue; 67 } 68 echo '<div class="ad-context__container">'; 69 printf( '<h3 class="ad-context__heading">%s</h3>', esc_html( $parent->name ) ); 70 if ( trim( $parent->description ) ) { 71 // Description exists. 72 printf( '<p class="description">%s</p>', nl2br( esc_html( $parent->description ) ) ); 73 } 74 foreach ( $children as $child ) { 75 printf( 76 '<p class="ad-context__item"><label><input type="checkbox" name="tax_input[%s][]" value="%d" %s /> %s</label></p>', 77 esc_attr( $child->taxonomy ), 78 esc_attr( $child->term_id ), 79 checked( in_array( $child->term_id, $selected, true ), true, false ), 80 esc_html( $child->name ) 81 ); 82 } 83 echo '</div> <!-- //ad-context__container -->'; 84 } 85 ?> 86 <p class="ad-context__info"> 87 <?php esc_html_e( 'Context is defined by theme or plugin.', 'taf' ); ?> 88 </p> 89 <?php 90 } 82 91 83 92 /** -
taro-ad-fields/trunk/readme.txt
r3268937 r3269009 3 3 Contributors: tarosky, Takahashi_Fumiki, yocchi161 4 4 Tags: advertisement 5 Stable tag: 1.3. 35 Stable tag: 1.3.4 6 6 License: GPLv3 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-3.0.txt -
taro-ad-fields/trunk/taro-ad-fields.php
r3268937 r3269009 12 12 Domain Path: /languages/ 13 13 License: GPL v3 or later. 14 Version: 1.3. 314 Version: 1.3.4 15 15 */ 16 16 -
taro-ad-fields/trunk/vendor/composer/installed.php
r3268937 r3269009 2 2 'root' => array( 3 3 'name' => 'tarosky/taro-ad-fields', 4 'pretty_version' => '1.3. 3',5 'version' => '1.3. 3.0',6 'reference' => ' cb322b1aca95dfbeb5103b10f2bc1d375f69ee3a',4 'pretty_version' => '1.3.4', 5 'version' => '1.3.4.0', 6 'reference' => 'ea743641a149109307d2d82868f312d595c38821', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'tarosky/taro-ad-fields' => array( 14 'pretty_version' => '1.3. 3',15 'version' => '1.3. 3.0',16 'reference' => ' cb322b1aca95dfbeb5103b10f2bc1d375f69ee3a',14 'pretty_version' => '1.3.4', 15 'version' => '1.3.4.0', 16 'reference' => 'ea743641a149109307d2d82868f312d595c38821', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.