This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wcps_slider_query_args', 'wcps_slider_query_args_custom', 10, 2); | |
function wcps_slider_query_args_custom($query_args, $args) | |
{ | |
$wcps_id = isset($args['wcps_id']) ? (int) $args['wcps_id'] : 0; | |
if ($wcps_id == '877') { | |
// do for wcps id 877 | |
$query_args['tax_query'] = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function post_grid_query_args_20200429($query_args, $args){ | |
$query_args['tag'] = 'tag 1, tag 2, tag 3'; | |
return $query_args; | |
} | |
add_filter('post_grid_query_args','post_grid_query_args_20200429', 10, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_action('qa_question_submitted', 'qa_question_submitted_notification', 50, 2); | |
add_action('qa_question_submitted', 'qa_question_submitted_notification_custom', 50, 2); | |
function qa_question_submitted_notification_custom($question_ID, $post_data) | |
{ | |
$q_category = get_the_terms($question_ID, 'question_cat'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var post_content = `<!-- wp:paragraph --> | |
<p>Hello</p> | |
<!-- /wp:paragraph --> | |
<!-- wp:list --> | |
<ul> | |
<li>hello 1</li> | |
<li>hello 2</li> | |
<li> </li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var content = "Test content"; | |
var name = 'core/paragraph'; | |
// var name = 'core/html'; | |
var insertedBlock = wp.blocks.createBlock(name, { | |
content: content, | |
}); | |
wp.data.dispatch('core/editor').insertBlocks(insertedBlock); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Server Side | |
add_action('init', 'get_request_args'); | |
public function get_request_args(){ | |
if (isset($_REQUEST['args'])) { | |
$json = isset($_REQUEST['args']) ? sanitize_text_field($_REQUEST['args']) : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seleceted: Your latest posts | |
// if(is_front_page() && is_home()) | |
Seleceted: A static page (select below) | |
Homepage: | |
// if( is_front_page()) | |
Posts page: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function me_search_query( $query ) { | |
if ( $query->is_search ) { | |
$meta_query_args = array( | |
array( | |
'key' => 'accordions_options', | |
'value' => $query->query_vars['s'] = '', | |
'compare' => 'LIKE', | |
), | |
); | |
$query->set('meta_query', $meta_query_args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('post_grid_layout_element_title_link', 'post_grid_layout_element_title_link_20210615'); | |
function post_grid_layout_element_title_link_20210615($args){ | |
$element = isset($args['element']) ? $args['element'] : array(); | |
$elementIndex = isset($args['index']) ? $args['index'] : ''; | |
$post_id = isset($args['post_id']) ? $args['post_id'] : ''; |