Hot answers tagged

4

Explanation: The issue you are likely facing is that you are trying to add your ajax actions from within the widget itself that may be instantiated on the elementor/widgets/widgets_registered hook. If so, this is hook elementor/widgets/widgets_registered is too late and do_action( "wp_ajax_{$action}" ) and do_action( "wp_ajax_nopriv_{$action}" ) have ...


2

Currently you can not unset key because you can not find proper key from array. The issue is that you did $stamp = array($_POST['stamp']); as array which is wrong. you have to remove array() from $stamp, so which look like $stamp = $_POST['stamp'];. then you can search value in column from array and unset it. I have tested below code which is working ...


2

The problem is that, you have added extra white space before wp_ajax action. remove space from actions ' wp_ajax_my_action' and ' wp_ajax_nopriv_my_action'. because of extra space before ajax request, showing the 400 bad request error. You should use : add_action('wp_ajax_my_action', 'my_action'); add_action('wp_ajax_nopriv_my_action', 'my_action');


1

If you have a form you should have a sort field in it, so that you can send your order value on form submit. This way you can send the sorting parameter to your backend callback function. If you don't have a form you shoud add this parameter to another element with a data attribute like that: <button id="load-more" data-order="DESC">Load More</...


1

You might try conditional classes instead. In your regular "style.css" file you would include both classes: .theme-header-title.green { color:green; } .theme-header-title.blue { color:blue; } (Tip 1: avoid !important, just use a more specific style if needed - for example, h1.theme-header-title.green.) Then in your HTML, which is likely in your "header....


Only top voted, non community-wiki answers of a minimum length are eligible