Changeset 3209964
- Timestamp:
- 12/18/2024 04:16:13 PM (15 months ago)
- Location:
- jeero/trunk
- Files:
-
- 8 edited
-
Jeero.php (modified) (2 diffs)
-
assets/css/admin.css (modified) (1 diff)
-
includes/Calendars/Post_Based_Calendar.php (modified) (2 diffs)
-
includes/Mother/Mother.php (modified) (1 diff)
-
includes/Templates/Fields/Field.php (modified) (4 diffs)
-
includes/Templates/Fields/Group.php (modified) (2 diffs)
-
includes/Templates/Fields/Select.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jeero/trunk/Jeero.php
r3195465 r3209964 6 6 * Author: Slim & Dapper 7 7 * Author URI: https://slimndap.com 8 * Version: 1.30. 38 * Version: 1.30.4 9 9 * Text Domain: jeero 10 10 * … … 19 19 } 20 20 21 define( 'Jeero\VERSION', '1.30. 3' );21 define( 'Jeero\VERSION', '1.30.4' ); 22 22 define( 'Jeero\PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); 23 23 define( 'Jeero\PLUGIN_URI', plugin_dir_url( __FILE__ ) ); -
jeero/trunk/assets/css/admin.css
r3170160 r3209964 4 4 } 5 5 body.jeero_page_jeero-imports .jeero-field-message dl dt { 6 flex: 0 0 200px;6 flex: 0 0 300px; 7 7 } 8 8 body.jeero_page_jeero-imports .jeero-field-message dl dd { 9 flex: 0 0 calc(100% - 200px);9 flex: 0 0 calc(100% - 300px); 10 10 margin-left: 0; 11 11 } -
jeero/trunk/includes/Calendars/Post_Based_Calendar.php
r3171580 r3209964 523 523 Stats\cache_get( 'events_updated' ) + 1 524 524 ); 525 526 /** 527 * Fires after an event is updated. 528 * 529 * @since 1.30.4 530 * 531 * @param int $post_id The ID of the updated post. 532 * @param array $data The structured event data. 533 * @param array $raw The raw event data from the source. 534 * @param string $theater The source of the event data. 535 * @param object $subscription The subscription object. 536 */ 537 do_action( 'Jeero\Calendars\Post_Based_Calendar\event_updated', $post_id, $data, $raw, $theater, $subscription ); 538 525 539 526 540 } else { … … 550 564 Stats\cache_get( 'events_created' ) + 1 551 565 ); 566 567 /** 568 * Fires after a new event is created. 569 * 570 * @since 1.30.4 571 * 572 * @param int $post_id The ID of the newly created post. 573 * @param array $data The structured event data. 574 * @param array $raw The raw event data from the source. 575 * @param string $theater The source of the event data. 576 * @param object $subscription The subscription object. 577 */ 578 do_action( 'Jeero\Calendars\Post_Based_Calendar\event_created', $post_id, $data, $raw, $theater, $subscription ); 552 579 553 580 } -
jeero/trunk/includes/Mother/Mother.php
r3078338 r3209964 9 9 use Jeero\Db; 10 10 11 const BASE_URL = 'https://ql621w5yfk.execute-api.eu-west-1.amazonaws.com/jeero/v1'; 11 /** 12 * Base URL of Jeero's mother. 13 * 14 * @since 1.? 15 * @since 1.30.4 Now uses jeero.ooo domain. 16 */ 17 const BASE_URL = 'https://api.jeero.ooo/v1'; 12 18 const SITE_KEY = 'jeero/mother/site_key'; 13 19 -
jeero/trunk/includes/Templates/Fields/Field.php
r2553936 r3209964 36 36 protected $description; 37 37 38 /** 39 * @since 1.? 40 * @since 1.30.4 Label now uses name as fall back value. 41 * @return void 42 */ 38 43 function __construct( $args ) { 39 40 $args = wp_parse_args( $args, $this->get_defaults() ); 41 42 $this->args = $args; 43 $this->name = $args[ 'name' ]; 44 $this->label = $args[ 'label' ]; 45 $this->description = $args[ 'description' ]; 44 $this->args = wp_parse_args( $args, $this->get_defaults() ); 45 $this->name = $this->args[ 'name' ]; 46 $this->label = $this->args[ 'label' ] ?: $this->name; 47 $this->description = $this->args[ 'description' ]; 46 48 } 47 49 … … 99 101 * @since 1.10 100 102 * @since 1.15.4 Added support for prefix. 103 * @since 1.30.4 Prevent duplicate field names in the prefix when field is a nested field. 101 104 * 102 105 * @return string 103 106 */ 107 104 108 function get_example( $prefix = array(), $indent = 0 ) { 105 106 ob_start(); 107 ?>{{ <?php 108 if ( !empty( $prefix ) ) { 109 echo implode( '.', $prefix); ?>.<?php 109 $variable_parts = $prefix; 110 // Prevent duplicate field names in the prefix 111 if ( empty( $prefix ) || end( $prefix ) !== $this->name ) { 112 $variable_parts[] = $this->name; 110 113 } 111 echo $this->name; ?> }}<?php 112 return $this->indent_example( ob_get_clean(), $indent ); 113 114 $variable = implode( '.', $variable_parts ); 115 return $this->indent_example( "{{ $variable }}", $indent ); 114 116 } 115 117 … … 120 122 * @return array 121 123 */ 124 122 125 function get_variables( $prefix = array() ) { 123 126 return array( 124 127 array( 125 'name' => $this->name,128 'name' => implode( '.', array_merge( $prefix, array( $this->name ) ) ), 126 129 'description' => $this->get_description(), 127 'example' => false,130 'example' => false, 128 131 ), 129 132 ); 130 131 133 } 132 134 … … 147 149 148 150 return implode( "\n", $lines ); 149 151 150 152 } 151 152 153 } -
jeero/trunk/includes/Templates/Fields/Group.php
r2553936 r3209964 54 54 * @since 1.15.4 Added support for prefix. 55 55 * Added example code for sub fields. 56 * @since 1.30.4 Prevent duplicate field names in the prefix when field is a nested field. 56 57 * 57 58 * @return string 58 59 */ 59 60 function get_example( $prefix = array(), $indent = 0 ) { 60 61 // Prevent duplicate group names in the prefix 62 if ( empty( $prefix ) || end( $prefix ) !== $this->name ) { 63 $prefix[] = $this->name; 64 } 61 65 ob_start(); 62 66 ?> 63 <h3><?php 64 echo $this->label; 65 ?></h3> 66 <?php 67 $prefix[] = $this->name; 67 <h3><?php echo $this->label; ?></h3> 68 <?php 68 69 foreach( $this->sub_fields as $sub_field_args ) { 69 70 $sub_field = get_field_from_config( $sub_field_args ); 70 ?>71 72 <?php73 71 echo $sub_field->get_example( $prefix, $indent ); 72 ?> 73 74 <?php 74 75 } 75 76 76 return $this->indent_example( ob_get_clean(), $indent ); 77 77 } … … 81 81 * 82 82 * @since 1.10 83 * @since 1.30.4 Include prefix in the variable name when field is a nested field. 83 84 * @return array 84 85 */ 85 function get_variables( $prefix = array(), $indent = 0 ) { 86 return array( 87 array( 88 'name' => $this->name, 89 'description' => $this->get_description(), 90 'example' => $this->get_example( $prefix, $indent ), 91 ), 92 ); 93 86 function get_variables( $prefix = array() ) { 87 $variables = array(); 88 foreach( $this->sub_fields as $sub_field_args ) { 89 $sub_field = get_field_from_config( $sub_field_args ); 90 $variables = array_merge( $variables, $sub_field->get_variables( array_merge( $prefix, array( $this->name ) ) ) ); 91 } 92 return $variables; 94 93 } 95 94 -
jeero/trunk/includes/Templates/Fields/Select.php
r3171580 r3209964 7 7 8 8 class Select extends Field { 9 10 private $sub_fields; 9 11 10 private $item; 12 11 … … 47 46 * @since 1.10 48 47 * @since 1.15.4 Added support for prefix. 48 * @since 1.30.4 Prevent duplicate field names in the prefix when field is a nested field. 49 49 * 50 50 * @return string 51 51 */ 52 52 53 function get_example( $prefix = array(), $indent = 0 ) { 53 54 // Construct the full variable name with prefix 55 $full_name = implode( '.', array_merge( $prefix, array( $this->name ) ) ); 56 $item_var = $this->item[ 'name' ]; 57 54 58 ob_start(); 55 56 ?>{% if <?php echo $this->name; ?> %}59 ?> 60 {% if <?php echo $full_name; ?> %} 57 61 <h3><?php echo $this->label; ?></h3> 58 62 <ul> 59 {% for <?php echo $ this->item[ 'name' ]; ?> in <?php echo $this->name; ?> %}63 {% for <?php echo $item_var; ?> in <?php echo $full_name; ?> %} 60 64 <li> 61 65 <?php 62 $field = get_field_from_config( $this->item ); 63 echo $field->get_example( $prefix, $indent + 3 ); 66 // Reset the prefix to the loop variable for sub-fields 67 $field = get_field_from_config( $this->item ); 68 echo $field->get_example( array( $item_var ), $indent + 3 ); 64 69 ?> 65 70 … … 67 72 {% endfor %} 68 73 </ul> 69 {% endif %} <?php70 74 {% endif %} 75 <?php 71 76 return $this->indent_example( ob_get_clean(), $indent ); 72 77 } … … 76 81 * 77 82 * @since 1.10 83 * @since 1.30.4 Include prefix in the variable name when field is a nested field. 78 84 * @return array 79 85 */ 80 86 function get_variables( $prefix = array() ) { 87 // Include prefix in the variable name 81 88 return array( 82 89 array( 83 'name' => $this->name,90 'name' => implode( '.', array_merge( $prefix, array( $this->name ) ) ), 84 91 'description' => $this->get_description(), 85 'example' => $this->get_example( $prefix ),92 'example' => $this->get_example( $prefix ), 86 93 ), 87 94 ); 88 89 95 } 90 96 91 92 97 } -
jeero/trunk/readme.txt
r3195465 r3209964 100 100 * Added a settings page. 101 101 * Added statistics to the debug page. 102 * Introduced two new filters in preparation of an exciting new feature: Automations (1.30.4). 102 103 103 104 = 1.29 = … … 262 263 == Upgrade Notice == 263 264 265 = 1.30.4 = 266 Improvements to Twig examples inside Jeero settings. 267 264 268 = 1.30.3 = 265 266 269 Fixes a problem with the import of Custom Post Types. 267 270
Note: See TracChangeset
for help on using the changeset viewer.