Tag Info

Hot answers tagged

2

As this is an AJAX function your function must exit; or die(); after the final line of executed code, in this case outside of the if statement before the final } However I don't think this is the true issue, if you are getting a 0 returned in my experience it means the function is not running because admin-ajax.php returns 0 if it hits the end of the file ...


1

My solution to this problem when extending the Walker_Nav_Menu was to skip check if current_page_parent when C.P.T. I identified C.P.Ts following this stackexchange post. This does not entirely solve the problem as I am using current_page_item for C.P.T parent menu items, but it does achieve the desired outcome. Here is my class. class My_Menu extends ...


1

This: $thm_out[array_rand($thm_out, 2)] is the same as $them_out[array(0,2)] where 0 and 2 are 2 random keys. See array_rand I hope you can see what is wrong there. Change that to: $thm_out[array_rand($thm_out, 1)] which is the same as $them_out[2] where 2 is any random key.


1

Is there a way into making Wordpress think that the Google mail servers are local mail servers so that phpmail can be used properly? Yes, you could use a firewall to create a localhost:465 socket that forwards network traffic to smtp.gmail.com:465 but what on earth for?? Is there an alternative solutions? Yes, and you're half way there with ...


1

What would you do if the user uses a proxy and randomizes his IP address? There are numerous browser plugins to simplify that to a click of a button to download multiple times. The same goes for cookies. Aside from that you are trying to collect data that allows to identify users, which is illegal in lots of countries. What (could) work much better is a ...


1

For anyone else having this issue - the working code looks like this (placed in the functions.php file): function default_post_type($post_id) { if (in_category('YouTube')) { set_post_format($post_id, 'video'); } } add_action( 'publish_post', 'default_post_type' ); Happy WordPressing


1

First of all, some recommended reading - AJAX in Plugins. I realise this is not a plugin, but the Codex is still relevant, and as you'll see in the PHP section, you can use the WP AJAX handler to handle front end calls as well as those from the admin area. Javascript For this, you would be better advised putting your JS in an external *.js file that is ...


1

Couldn't find anything built in to WP to do this, but there's a good tutorial on this site for setting something up like this: This does not support custom format so I recommend using the original post function http://www.renegadetechconsulting.com/tutorials/jquery-datepicker-and-wordpress-i18n You can also find a Gist of the code here: ...



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