UP?cUqU<U+LU`E[UPPBU<MU>cUqU<U`tUpLU(E[UdU`]&UPU<UU`+U` /UU` QxU 0MYU0NLU0E[UPB[UP`BU@<U@PUP@+>U *UPpQ%Up/Up>U*U0tUp>U@>Ы ~Ы ~ ~ ~RA~~@ U? ~ ~A(A(A@ U(A@ ~ ~XAtwU@P;?LU=EKUP=tKU`=tU`=<hU`pp=GLU`>EKUpP>tKU``>tU><tU0p>HLU AEKU0PAtKU `AtUA<hUAGuU=HuUCHuU=HU=GUFpUPPFuUF<UFHU`pFHuUP`pHH(UpH|UpH>4UJ|UJ>` ~` ~XAP ~AxgA ~Є ~XA ~AΩA ~@ ~XA" ~ASA ~4A! ~8AC~ ~ ~^Ah! ~8A@qwcUqU<UPtU`LUE[UPPBU<U`U@ UpLUEKU PtKU`t[UPpBU<ULU E[UPB[U``B[UppBU <U LU(E[UPPB[U`B[U`pB[UpBU@<UP@tUP>U@>H%AH%Ans::verifyNonce() ) { unset( $_REQUEST['action'] ); unset( $_REQUEST[ rtTPG()->nonceId() ] ); unset( $_REQUEST['_wp_http_referer'] ); unset( $_REQUEST['uid'] ); update_option( rtTPG()->options['settings'], wp_unslash( $_REQUEST ) ); $response = [ 'error' => false, 'msg' => esc_html__( 'Settings successfully updated', 'the-post-grid' ), ]; } else { $response = [ 'error' => $error, 'msg' => esc_html__( 'Session Error !!', 'the-post-grid' ), ]; } wp_send_json( $response ); die(); } /** * Taxonomy list. * * @return void */ public function rtTPGTaxonomyListByPostType() { $error = true; $msg = $data = null; $is_ok = true; if ( ! current_user_can( 'edit_posts' ) ) { $is_ok = false; } if ( ! Fns::verifyNonce() ) { $is_ok = false; } if ( $is_ok ) { $error = false; $taxonomies = Fns::rt_get_all_taxonomy_by_post_type( $_REQUEST['post_type'] ); if ( is_array( $taxonomies ) && ! empty( $taxonomies ) ) { $data .= Fns::rtFieldGenerator( [ 'tpg_taxonomy' => [ 'type' => 'checkbox', 'label' => esc_html__( 'Taxonomy', 'the-post-grid' ), 'id' => 'post-taxonomy', 'multiple' => true, 'value' => isset( $_REQUEST['taxonomy'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['taxonomy'] ) ) : [], 'options' => $taxonomies, ], ] ); } else { $data = '
' . esc_html__( 'No Taxonomy found', 'the-post-grid' ) . '
'; } } else { $msg = esc_html__( 'Security error', 'the-post-grid' ); } wp_send_json( [ 'error' => $error, 'msg' => $msg, 'data' => $data, ] ); die(); } /** * Isotope Filter * * @return void */ public function rtTPGIsotopeFilter() { $error = true; $msg = $data = null; $is_ok = true; if ( ! current_user_can( 'edit_posts' ) ) { $is_ok = false; } if ( ! Fns::verifyNonce() ) { $is_ok = false; } if ( $is_ok ) { $error = false; $post_type = isset( $_REQUEST['post_type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['post_type'] ) ) : null; $taxonomies = Fns::rt_get_taxonomy_for_filter( $post_type ); if ( is_array( $taxonomies ) && ! empty( $taxonomies ) ) { foreach ( $taxonomies as $tKey => $tax ) { $data .= ''; } } } else { $msg = esc_html__( 'Security error', 'the-post-grid' ); } wp_send_json( [ 'error' => $error, 'msg' => $msg, 'data' => $data, ] ); die(); } /** * Term list * * @return void */ public function rtTPGTermListByTaxonomy() { $error = true; $msg = $data = null; $is_ok = true; if ( ! current_user_can( 'edit_posts' ) ) { $is_ok = false; } if ( ! Fns::verifyNonce() ) { $is_ok = false; } if ( $is_ok ) { $error = false; $taxonomy = isset( $_REQUEST['taxonomy'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['taxonomy'] ) ) : null; $data .= "
"; $data .= Fns::rtFieldGenerator( [ 'term_' . $taxonomy => [ 'type' => 'select', 'label' => ucfirst( str_replace( '_', ' ', $taxonomy ) ), 'class' => 'rt-select2 full', 'id' => 'term-' . wp_rand(), 'holderClass' => "term-filter-item {$taxonomy}", 'value' => null, 'multiple' => true, 'options' => Fns::rt_get_all_term_by_taxonomy( $taxonomy ), ], ] ); $data .= Fns::rtFieldGenerator( [ 'term_operator_' . $taxonomy => [ 'type' => 'select', 'label' => esc_html__( 'Operator', 'the-post-grid' ), 'class' => 'rt-select2 full', 'holderClass' => "term-filter-item-operator {$taxonomy}", 'options' => Options::rtTermOperators(), ], ] ); $data .= '
'; } else { $msg = esc_html__( 'Security error', 'the-post-grid' ); } wp_send_json( [ 'error' => $error, 'msg' => $msg, 'data' => $data, ] ); die(); } /** * Shortcode list * * @return void */ public function shortCodeList() { $is_ok = true; if ( ! current_user_can( 'edit_posts' ) ) { $is_ok = false; } if ( $is_ok ) { $html = null; $scQ = new \WP_Query( apply_filters( 'tpg_sc_list_query_args', [ 'post_type' => rtTPG()->post_type, 'order_by' => 'title', 'order' => 'DESC', 'post_status' => 'publish', 'posts_per_page' => - 1, ] ) ); if ( $scQ->have_posts() ) { $html .= "
"; $html .= "
"; $html .= ''; $html .= "'; $html .= '
'; $html .= '
'; } else { $html .= '
' . esc_html__( 'No shortCode found.', 'the-post-grid' ) . '
'; } Fns::print_html( $html, true ); } else { echo esc_html__( 'Security error', 'the-post-grid' ); } die(); } }