base/", 'single_paged' ); } else { $url = remove_query_arg( 'p', $url ); } return $url; } protected function get_wp_link_page_url_for_preview( $post, $query_args, $url ) { if ( 'draft' === $post->post_status || ! isset( $_GET['preview_id'], $_GET['preview_nonce'] ) ) { return $url; } $query_args['preview_id'] = Utils::_unstable_get_super_global_value( $_GET, 'preview_id' ); $query_args['preview_nonce'] = Utils::_unstable_get_super_global_value( $_GET, 'preview_nonce' ); if ( $this->is_rest_request() || ! $this->current_url_contains_taxonomy_filter() ) { return get_preview_post_link( $post, $query_args, $url ); } wp_parse_str( htmlspecialchars_decode( Utils::_unstable_get_super_global_value( $_SERVER, 'QUERY_STRING' ) ), $query_params ); foreach ( $query_params as $param_key => $param_value ) { if ( false !== strpos( $param_key, 'e-filter-' ) ) { $query_args[ $param_key ] = $param_value; } } return get_preview_post_link( $post, $query_args, $url ); } protected function get_wp_link_page_url_for_rest_request( $url, $link_unescaped ) { $url_components = wp_parse_url( $link_unescaped ); $query_args = []; if ( isset( $url_components['query'] ) ) { wp_parse_str( $url_components['query'], $query_args ); } $url = ! empty( $query_args ) ? $url . '&' . http_build_query( $query_args ) : $url; return $this->format_query_string_concatenation( $url ); } protected function get_wp_link_page_url_for_normal_page_load( $url ) { wp_parse_str( htmlspecialchars_decode( Utils::_unstable_get_super_global_value( $_SERVER, 'QUERY_STRING' ) ), $query_params ); $e_filters = ''; foreach ( $query_params as $param_key => $param_value ) { if ( strpos( $param_key, 'e-filter' ) ) { $e_filters .= '&' . $param_key . '=' . $param_value; } } return $this->format_query_string_concatenation( $url . $e_filters ); } public function current_url_contains_taxonomy_filter() { return strpos( Utils::_unstable_get_super_global_value( $_SERVER, 'QUERY_STRING' ), 'e-filter-' ); } public function referer_contains_taxonomy_filter() { return strpos( Utils::_unstable_get_super_global_value( $_SERVER, 'HTTP_REFERER' ), 'e-filter-' ); } protected function format_query_string_concatenation( $input ) { if ( false === strpos( $input, '?' ) ) { // If "?" doesn't exist in the input URL, replace the first "&" with "?" $input = preg_replace( '/&/', '?', $input, 1 ); } return $input; } public function get_posts_nav_link( $page_limit = null ) { if ( ! $page_limit ) { $page_limit = $this->query->max_num_pages; } $return = []; $paged = $this->get_current_page(); $link_template = '%s'; $disabled_template = '%s'; if ( $paged > 1 ) { $next_page = intval( $paged ) - 1; if ( $next_page < 1 ) { $next_page = 1; } $return['prev'] = sprintf( $link_template, 'prev', $this->get_wp_link_page( $next_page ), $this->get_settings_for_display( 'pagination_prev_label' ) ); } else { $return['prev'] = sprintf( $disabled_template, 'prev', $this->get_settings_for_display( 'pagination_prev_label' ) ); } $next_page = intval( $paged ) + 1; if ( $next_page <= $page_limit ) { $return['next'] = sprintf( $link_template, 'next', $this->get_wp_link_page( $next_page ), $this->get_settings_for_display( 'pagination_next_label' ) ); } else { $return['next'] = sprintf( $disabled_template, 'next', $this->get_settings_for_display( 'pagination_next_label' ) ); } return $return; } protected function register_controls() { $this->start_controls_section( 'section_layout', [ 'label' => esc_html__( 'Layout', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->end_controls_section(); } protected function get_pagination_type_options() { return [ '' => esc_html__( 'None', 'elementor-pro' ), 'numbers' => esc_html__( 'Numbers', 'elementor-pro' ), 'prev_next' => esc_html__( 'Previous/Next', 'elementor-pro' ), 'numbers_and_prev_next' => esc_html__( 'Numbers', 'elementor-pro' ) . ' + ' . esc_html__( 'Previous/Next', 'elementor-pro' ), self::LOAD_MORE_ON_CLICK => esc_html__( 'Load on Click', 'elementor-pro' ), self::LOAD_MORE_INFINITE_SCROLL => esc_html__( 'Infinite Scroll', 'elementor-pro' ), ]; } public function render_plain_content() {} }