| Server IP : 68.183.124.220 / Your IP : 216.73.217.137 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins/elementor/includes/elements/ |
Upload File : |
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Elementor repeater element.
*
* Elementor repeater handler class is responsible for initializing the repeater.
*
* @since 1.0.0
*/
class Repeater extends Element_Base {
/**
* Repeater counter.
*
* Holds the Repeater counter data. Default is `0`.
*
* @since 1.0.0
* @access private
* @static
*
* @var int Repeater counter.
*/
private static $counter = 0;
/**
* Repeater constructor.
*
* Initializing Elementor repeater element.
*
* @since 1.0.7
* @access public
*
* @param array $data Optional. Element data. Default is an empty array.
* @param array|null $args Optional. Element default arguments. Default is null.
*
*/
public function __construct( array $data = [], array $args = null ) {
self::$counter++;
parent::__construct( $data, $args );
}
/**
* Get repeater name.
*
* Retrieve the repeater name.
*
* @since 1.0.7
* @access public
*
* @return string Repeater name.
*/
public function get_name() {
return 'repeater-' . self::$counter;
}
/**
* Get repeater type.
*
* Retrieve the repeater type.
*
* @since 1.0.0
* @access public
* @static
*
* @return string Repeater type.
*/
public static function get_type() {
return 'repeater';
}
/**
* Add new repeater control to stack.
*
* Register a repeater control to allow the user to set/update data.
*
* This method should be used inside `_register_controls()`.
*
* @since 1.0.0
* @access public
*
* @param string $id Repeater control ID.
* @param array $args Repeater control arguments.
* @param array $options Optional. Repeater control options. Default is an
* empty array.
*
* @return bool True if repeater control added, False otherwise.
*/
public function add_control( $id, array $args, $options = [] ) {
$current_tab = $this->get_current_tab();
if ( null !== $current_tab ) {
$args = array_merge( $args, $current_tab );
}
return Plugin::$instance->controls_manager->add_control_to_stack( $this, $id, $args, $options );
}
/**
* Get repeater fields.
*
* Retrieve the fields from the current repeater control.
*
* @since 1.5.0
* @deprecated 2.1.0 Use `Repeater::get_controls()` instead.
* @access public
*
* @return array Repeater fields.
*/
public function get_fields() {
_deprecated_function( __METHOD__, '2.1.0', __CLASS__ . '::get_controls()' );
return array_values( $this->get_controls() );
}
/**
* Get default child type.
*
* Retrieve the repeater child type based on element data.
*
* Note that repeater does not support children, therefore it returns false.
*
* @since 1.0.0
* @access protected
*
* @param array $element_data Element ID.
*
* @return false Repeater default child type or False if type not found.
*/
protected function _get_default_child_type( array $element_data ) {
return false;
}
}