This file contains hidden or 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
const { applyFilters, doAction, addFilter } = wp.hooks; | |
let some_option = applyFilters('some-option', [{ label: 'Some Option' }]); | |
addFilter('some-option', 'post-grid/post-grid/queryPrams', function (options) { | |
//console.log(options); | |
This file contains hidden or 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
Done | |
https://iconsax.io/ | |
https://humbleicons.com/ | |
https://www.mingcute.com/ | |
https://sargamicons.com/ | |
https://licons.xyz/ | |
https://feathericons.com/ | |
https://experience-japan.info/ | |
https://akaricons.com/ | |
https://flagpack.xyz/ |
This file contains hidden or 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_20200303', 10, 2); | |
function wcps_slider_query_args_20200303($query_args, $args) | |
{ | |
// search by keyword | |
$query_args['author__in'] = [2]; | |
return $query_args; | |
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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']) : ''; |