How to insert PHP code in a WordPress Post

You cannot save raw PHP inside post content, it gets cleaned out on save. This is an obvious security precaution. However, there are plugins that will enable you to do this, for example: http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/ This is not recommended though, better solution would be to create a generic shortcode for your from.

Get selected values from checkboxes and radio buttons via Gravity Forms gform_after_submission hook [closed]

If you have the form/field object you can retrieve a comma separated string containing the fields selected choices by using the GF_Field::get_value_export() method which was added in Gravity Forms 1.9.13. If you are only going to use it with one or two fields you could do something like this: $field_id = 4; $field = GFFormsModel::get_field( … Read more

wp_dropdown_categories with multiple select

wp_dropdown_categories has a filter applied to the output that is called right before the function returns or echos the output. With this you can add a filter to your funtions.php file that manipulates the select field and adds a multiple attribute to it. The filter below would search for the select opening tag and add … Read more

How to call WordPress functions from a form processing script

You should never post anything to plugins files directly. It’s almost always a security flaw and it prevents site owner from hardening the site properly (in perfect situation no requests to PHP files inside wp-content should be necessary at all) Good practice is that you use admin_post actions… (similar to admin_ajax). So your form should … Read more

How to exclude pages from the search results

Note that when we use: $query->set( ‘post_type’, ‘post’ ); then we’re overriding all searchable post types, not only the page post type. That may be just fine in some cases, and we’re done using some of your pre_get_posts snippets that fit our needs. But sometimes we don’t want to hard fix it that way. Here … Read more

User registration problem in WordPress

Look at the code in wp-login.php (line 481 and following). There you can see how registration works. The names of your form – email, name – are probably overwritten by WordPress. Always use prefixed names in forms to avoid collisions, eg.: ma_email and ma_name. Prepare incoming data. Do not just write anything someone sends you … Read more

jQuery and AJAX Not working with Select Form Element

instead of this: jQuery(‘#wpuf_new_post_form’).submit(function(e) { Try this way, it should work for you. jQuery(document).on(“submit”, “#wpuf_new_post_form” , (function(e)) { var data2 = jQuery(‘#wpuf_new_post_form’).serialize(); first do console.log(data2) try it, should print entire form ‘s data in console.

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