Tag Info

Hot answers tagged

2

In Wordpress Ajax works this way: First, you register the ajax action and the function you want to use to serve that function, of course, you have to write that function. All the request go to the same URL wp-admin/admin-ajax.php, what it changes is the action, and depending on the action, a different function is called. The function you call, returns the ...


1

First, create a function to process the form. In the shortcode function, first process the form and then return any form/message that you want to display to the user. /** * Plugin Name: NewsletterFormConnector * Description: Newsletter Form to connect to Newsletter Api * Author: emjay * Version: 1.0 */ //Add function file ...


1

If I am understanding the question correctly, you should be able to do a query for the media by user id. Something like the follow (untested) code: //only do this if there is a user logged in if( is_user_logged_in() ) { //get the currenly logged in user $user_ID = get_current_user_id(); $upload_args = array( 'post_type' => ...


1

It looks like you can use the ninja_forms_display_init action to populate a field. To get the job ID from the URL you mentioned above you can use the $_GET array. Adapting the code from that documentation page, something like this should achieve what you're looking for: function wpse_158000_populate_field($form_id) { global $ninja_forms_loading; ...


1

If you want to add some custom HTML between the </h3> and the <form> tags, you can try the following: /** * Add custom HTML between the `</h3>` and the `<form>` tags in the comment_form() output. */ add_action( 'comment_form_before', function(){ add_filter( 'pre_option_comment_registration', 'wpse_156112' ); }); function ...


1

Your validation is not working because the variables with the empty array return true with isset; Go to http://writecodeonline.com/php/ and try this code, and you'll understand: $test = ""; if ( isset($test) ){ echo "true"; } The right function for it, instead of isset is empty. Try it out: $test = ""; if ( empty($test) ){ echo "empty"; } ...


1

Wordpress doesn't work this way. If you want to work with a framework like Wordpress, you should obey its rules! Of course you can add a database record like this, but it is a really bad approach. Try some plugins for creating and saving forms in Wordpress like Ninja Forms or Quform. You can even do it yourself, but its not recommended for Wordpress ...



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