Plugin Directory

Changeset 3209964


Ignore:
Timestamp:
12/18/2024 04:16:13 PM (15 months ago)
Author:
slimndap
Message:

v1.30.4

Location:
jeero/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • jeero/trunk/Jeero.php

    r3195465 r3209964  
    66 * Author:          Slim & Dapper
    77 * Author URI:      https://slimndap.com
    8  * Version:         1.30.3
     8 * Version:         1.30.4
    99 * Text Domain:     jeero
    1010 *
     
    1919}
    2020
    21 define( 'Jeero\VERSION', '1.30.3' );
     21define( 'Jeero\VERSION', '1.30.4' );
    2222define( 'Jeero\PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    2323define( 'Jeero\PLUGIN_URI', plugin_dir_url( __FILE__ ) );
  • jeero/trunk/assets/css/admin.css

    r3170160 r3209964  
    44}
    55body.jeero_page_jeero-imports .jeero-field-message dl dt {
    6   flex: 0 0 200px;
     6  flex: 0 0 300px;
    77}
    88body.jeero_page_jeero-imports .jeero-field-message dl dd {
    9   flex: 0 0 calc(100% - 200px);
     9  flex: 0 0 calc(100% - 300px);
    1010  margin-left: 0;
    1111}
  • jeero/trunk/includes/Calendars/Post_Based_Calendar.php

    r3171580 r3209964  
    523523                Stats\cache_get( 'events_updated' ) + 1
    524524            );
     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
    525539       
    526540        } else {
     
    550564                Stats\cache_get( 'events_created' ) + 1
    551565            );
     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 );
    552579       
    553580        }
  • jeero/trunk/includes/Mother/Mother.php

    r3078338 r3209964  
    99use Jeero\Db;
    1010
    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 */
     17const BASE_URL = 'https://api.jeero.ooo/v1';
    1218const SITE_KEY = 'jeero/mother/site_key';
    1319
  • jeero/trunk/includes/Templates/Fields/Field.php

    r2553936 r3209964  
    3636    protected $description;
    3737   
     38    /**
     39     * @since   1.?
     40     * @since   1.30.4  Label now uses name as fall back value.
     41     * @return  void
     42     */
    3843    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' ];
    4648    }
    4749   
     
    99101     * @since   1.10
    100102     * @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.
    101104     *
    102105     * @return  string
    103106     */
     107
    104108    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;
    110113        }
    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 );
    114116    }
    115117   
     
    120122     * @return  array
    121123     */
     124
    122125    function get_variables( $prefix = array() ) {
    123126        return array(
    124127            array(
    125                 'name' => $this->name,
     128                'name'        => implode( '.', array_merge( $prefix, array( $this->name ) ) ),
    126129                'description' => $this->get_description(),
    127                 'example' => false,
     130                'example'     => false,
    128131            ),
    129132        );
    130        
    131133    }
    132134   
     
    147149       
    148150        return implode( "\n", $lines );
    149        
     151
    150152    }
    151    
    152153}
  • jeero/trunk/includes/Templates/Fields/Group.php

    r2553936 r3209964  
    5454     * @since   1.15.4  Added support for prefix.
    5555     *                  Added example code for sub fields.
     56     * @since   1.30.4  Prevent duplicate field names in the prefix when field is a nested field.
    5657     *
    5758     * @return  string
    5859     */
    5960    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        }
    6165        ob_start();
    6266?>
    63 <h3><?php
    64         echo $this->label;
    65 ?></h3>
    66 <?php       
    67         $prefix[] = $this->name;
     67<h3><?php echo $this->label; ?></h3>
     68<?php
    6869        foreach( $this->sub_fields as $sub_field_args ) {
    6970            $sub_field = get_field_from_config( $sub_field_args );
    70 ?>
    71 
    72 <?php
    7371            echo $sub_field->get_example( $prefix, $indent );
     72            ?>
     73                       
     74<?php
    7475        }
    75            
    7676        return $this->indent_example( ob_get_clean(), $indent );
    7777    }
     
    8181     *
    8282     * @since   1.10
     83     * @since   1.30.4  Include prefix in the variable name when field is a nested field.
    8384     * @return  array
    8485     */
    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;
    9493    }
    9594   
  • jeero/trunk/includes/Templates/Fields/Select.php

    r3171580 r3209964  
    77
    88class Select extends Field {
    9    
    10     private $sub_fields;
     9
    1110    private $item;
    1211
     
    4746     * @since   1.10
    4847     * @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.
    4949     *
    5050     * @return  string
    5151     */
     52
    5253    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
    5458        ob_start();
    55 
    56 ?>{% if <?php echo $this->name; ?> %}
     59?>
     60{% if <?php echo $full_name; ?> %}
    5761<h3><?php echo $this->label; ?></h3>
    5862<ul>
    59     {% for <?php echo $this->item[ 'name' ]; ?> in <?php echo $this->name; ?> %}
     63    {% for <?php echo $item_var; ?> in <?php echo $full_name; ?> %}
    6064        <li>
    6165<?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 );
    6469?>
    6570
     
    6772    {% endfor %}
    6873</ul>
    69 {% endif %}<?php
    70    
     74{% endif %}
     75<?php
    7176        return $this->indent_example( ob_get_clean(), $indent );
    7277    }
     
    7681     *
    7782     * @since   1.10
     83     * @since   1.30.4  Include prefix in the variable name when field is a nested field.
    7884     * @return  array
    7985     */
    8086    function get_variables( $prefix = array() ) {
     87        // Include prefix in the variable name
    8188        return array(
    8289            array(
    83                 'name' => $this->name,
     90                'name'        => implode( '.', array_merge( $prefix, array( $this->name ) ) ),
    8491                'description' => $this->get_description(),
    85                 'example' => $this->get_example( $prefix ),
     92                'example'     => $this->get_example( $prefix ),
    8693            ),
    8794        );
    88        
    8995    }
    9096
    91    
    9297}
  • jeero/trunk/readme.txt

    r3195465 r3209964  
    100100* Added a settings page.
    101101* Added statistics to the debug page.
     102* Introduced two new filters in preparation of an exciting new feature: Automations (1.30.4).
    102103
    103104= 1.29 =
     
    262263== Upgrade Notice ==
    263264
     265= 1.30.4 =
     266Improvements to Twig examples inside Jeero settings.
     267
    264268= 1.30.3 =
    265 
    266269Fixes a problem with the import of Custom Post Types.
    267270
Note: See TracChangeset for help on using the changeset viewer.