8889841cbimatime.clix.co.tz/wp-content/plugins/elementor-pro/modules/dynamic-tags/tags/internal-url.php000064400000007331150432056710031526 0ustar00home/clixcotzget_settings(); $type = $settings['type']; $url = ''; if ( 'post' === $type && ! empty( $settings['post_id'] ) ) { $url = get_permalink( (int) $settings['post_id'] ); } elseif ( 'taxonomy' === $type && ! empty( $settings['taxonomy_id'] ) ) { $url = get_term_link( (int) $settings['taxonomy_id'] ); } elseif ( 'attachment' === $type && ! empty( $settings['attachment_id'] ) ) { $url = get_attachment_link( (int) $settings['attachment_id'] ); } elseif ( 'author' === $type && ! empty( $settings['author_id'] ) ) { $url = get_author_posts_url( (int) $settings['author_id'] ); } if ( ! is_wp_error( $url ) ) { return $url; } return ''; } protected function register_controls() { $this->add_control( 'type', [ 'label' => esc_html__( 'Type', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'post' => esc_html__( 'Content', 'elementor-pro' ), 'taxonomy' => esc_html__( 'Taxonomy', 'elementor-pro' ), 'attachment' => esc_html__( 'Media', 'elementor-pro' ), 'author' => esc_html__( 'Author', 'elementor-pro' ), ], ] ); $this->add_control( 'post_id', [ 'label' => esc_html__( 'Search & Select', 'elementor-pro' ), 'type' => QueryModule::QUERY_CONTROL_ID, 'options' => [], 'label_block' => true, 'autocomplete' => [ 'object' => QueryModule::QUERY_OBJECT_POST, 'display' => 'detailed', 'query' => [ 'post_type' => 'any', ], ], 'condition' => [ 'type' => 'post', ], ] ); $this->add_control( 'taxonomy_id', [ 'label' => esc_html__( 'Search & Select', 'elementor-pro' ), 'type' => QueryModule::QUERY_CONTROL_ID, 'options' => [], 'label_block' => true, 'autocomplete' => [ 'object' => QueryModule::QUERY_OBJECT_TAX, 'display' => 'detailed', ], 'condition' => [ 'type' => 'taxonomy', ], ] ); $this->add_control( 'attachment_id', [ 'label' => esc_html__( 'Search & Select', 'elementor-pro' ), 'type' => QueryModule::QUERY_CONTROL_ID, 'options' => [], 'label_block' => true, 'autocomplete' => [ 'object' => QueryModule::QUERY_OBJECT_ATTACHMENT, 'display' => 'detailed', ], 'condition' => [ 'type' => 'attachment', ], ] ); $this->add_control( 'author_id', [ 'label' => esc_html__( 'Search & Select', 'elementor-pro' ), 'type' => QueryModule::QUERY_CONTROL_ID, 'options' => [], 'label_block' => true, 'autocomplete' => [ 'object' => QueryModule::QUERY_OBJECT_AUTHOR, 'display' => 'detailed', ], 'condition' => [ 'type' => 'author', ], ] ); } }