admin_post hook not working

You’re missing a ‘ in your code and your function name is different. function my_maybe_add_redirect( $entry, $form ) { wp_redirect( ‘https://www.google.com/’, 301 ); exit(); } add_action( ‘admin_post_submit_images’, ‘my_maybe_add_redirect’, 10, 2 );

HOW TO Insert Existing PHP Code to WOrdPress

Generally speaking, you can typically take PHP code and place a comment at the top: <?php /* Plugin Name: My SOAP Plugin */ ?> You can then create a folder for the plugin inside /wp-content/plugins/ (for example, /wp-conten/plugins/my-soap-plugin/) and place the PHP file inside that folder. At that point, you can activate the plugin from … Read more

How to develop an extension for a simple form post and post back? [closed]

I think the easiest way is adding the form via the Shortcode API. The code would look like this: function myform_handler( $atts ){ if (isset(@$_REQUEST[‘submit’])) { //Do something } else { $return = ‘<form action=”” method=”post”> <input type=”text” name=”myfield”> <input type=”submit” name=”submit> </form>’; } return $return; } add_shortcode( ‘myform’, ‘myform_handler’ ); Then you can add … Read more

How to get formidable entry ID by post ID? [closed]

So, after a lot of searching (which is funny, because it’s such a basic function which should apear in the documents) i found that: what you have to do to get the current post entry id is: <?php $entry_id = $wpdb->get_var(“SELECT id FROM $frmdb->entries WHERE post_id='”. $post->ID .”‘”); ?>

How to pass username into form that sends data to database

If you want to output the $id, you need to echo. Also be sure to use esc_attr() as a good security practice. <input type=”hidden” name=”id” value=”[insert_php]echo esc_attr( $id );[/insert_php]”> In addition, as was noted in another answer, you’re calling it an ‘id’, but you’re actually using the login (username). If all you need is the … Read more

Reply to a specific comment?

Yes, it is possible.You can integrate a custom template for comment detail page where users will start thread on particular comment. You can create a URL using add_rewrite_rule. also add query vars for URL. Here you can get that query var and use template_redirect hook to to include a template by apply condition for that … Read more

ajax form function error

This error is telling you that there was a 500 error in the PHP of your AJAX callback: jquery.js:8625 POST /admin-ajax.php 500 () This would be caused by a syntax error or other coding mistake. In looking at your code one obvious major problem is here: // use \Aws\Polly\PollyClient; // this was moved to before … Read more

Adding a “Report the post” button/form?

To use the plugin in the question you linked to: Copy the code into notepad or an equivalent program Save the file using the extension .php (make sure your operating system has file endings turned on so it doesn’t save as filename.php.txt Put the file into a compressed (or zipped) folder. How you do this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)