Can admin-ajax.php be used for spam purposes? And if yes, how to prevent that?

This is why you use nonces. $.ajax({ type: “POST”, url: ‘/wp-admin/admin-ajax.php’, data: { action: ‘mail_function’, message: ‘test’, _nonce: <?php echo wp_create_nonce( ‘mail_function_’ . $post->ID ) ?>}, dataType: “html”, success: function(data) { } }); Then in your PHP function: function my_ajax_mailer() { if ( ! wp_verify_nonce( $_REQUEST[‘_nonce’], ‘mail_function_’ . $post->ID ) ) return; // send mail… … Read more

WordPress woocommerce shipping order [closed]

Address fields are controlled by the WC_Countries class and can be filtered via: $address_fields = apply_filters( ‘woocommerce_’ . $type . ‘fields’, $address_fields, $country ); where there are 2 $types: billing and shipping. Once you’ve found that it is just PHP array manipulation: function reorder_shipping_fields( $address_fields ){ if ( isset( $address_fields[‘shipping_company’] ) ){ $shipping_company = $address_fields[‘shipping_company’]; … Read more

Min height of page [closed]

You should set min-height to 900px instead of just 900. 900 might work in some browsers, but probably not in yours.

Adding function to function.php error 505 [closed]

Editing your functions.php file is high risk, specially if it is a theme you acquired through purchasing or downloaded. There a several risks in doing that, firstly, just one simple syntax error, and site crash, like you explained. Secondly, if you upgrade the theme, all your changes will be lost. You won’t have that problem … Read more

Open everything in new tab

Looks like you are talking about the_excerpt. Following code will work, as you are looking for it: function custom_excerpt($more) { global $post; return ‘<a class=”moretag” target=”_blank” href=”‘. get_permalink($post->ID) . ‘”> Continue reading…</a>’; } add_filter(‘excerpt_more’, ‘custom_excerpt’); You will need to put it in your functions.php file.

User submitted post

You can create your form, submit it to PHP_SELF, sanatize your data and finally run your data through wp_insert_post() Function. You should be able to research everything else to achieve what you’re looking for but this will get you started. Good luck!

Retrieve Array from within Array [closed]

It looks like you are using Advanced Custom Fields. Your “Product ID” is storing the object, instead of just the ID. Below shows you how you can access the post ID, otherwise just change your field saving option for Product ID. It’s a simple foreach statement. foreach( $pages as $page ) { echo $page[‘product_id’]->ID; }