Tag Info

Hot answers tagged

2

I finally got it. First mistake was to process the same function twice. I've called it once after the function and one more time in ajax action. So when using the ajax call, the function got executed twice. In the example from the OP, this is not a problem at all, because it is simplified to do only one thing, but in my real code it does much more and can ...


2

If you check out the output() method in the includes/admin/class-wp-job-manager-setup.php file, namely this part: /** * Output addons page */ public function output() { $step = ! empty( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; if ( 3 === $step && ! empty( $_POST ) ) { $create_pages = isset( ...


1

Do you have to use localhost for any particular reason? The easiest fix for this will be to make those functions work correctly by putting a real hostname or ip address into the site address field in WordPress settings. Look in Settings > General Settings.


1

This can be done by going to Settings -> Permalinks. On Permalinks page select Custom Structure: www.inspurate.com/blog/%postname%/


1

You can just look at url, load the file and exit. That can be done when WordPress loaded its environment, e.g. on 'init'. add_action('init', function() { $url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH), '/'); if ( $url_path === 'retail' ) { // load the file if exists $load = locate_template('template-retail.php', true); ...


1

Make link like this <a href="http://example.com/?reaction=smk_remove_post&id=1226&_nonce=7be82cd4a0" data-id="1226" data-nonce="7be82cd4a0" class="smk-remove-post">Remove post</a> And jQuery $('.smk-remove-post').on( 'click', function( event ){ event.preventDefault(); var _this = $(this); var data = { 'action': ...


1

AJAX is not magical and when you request url X you will receive the same HTML for that url if you do it from the browser address bar, link or ajax. Therefor, if you want different response then the HTML you can not use the same url for the ajax request as in the link. Wordpress has a special "end point" to handle ajax request - admin-ajax.php and all ajax ...



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