This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add ACF data to the WP JSON REST API | |
*/ | |
add_filter( 'json_prepare_post', 'wpq_add_acf' ); | |
function wpq_add_acf( $post ) { | |
if( function_exists( 'get_fields' ) ) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Update post meta key via ajax POST request | |
* | |
* @see http://wpquestions.com/question/showLoggedIn/id/10604 | |
* | |
* On the remote site send a POST request to: | |
* | |
* http://example.tld/wp-admin/admin-ajax.php?action=update_post_meta | |
* | |
* with the following payload: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Inject posts of the custom post type 'usp_post', that are attached to the 'featured' term of the | |
* 'firstpage' taxonomy, into the main loop and the feed. | |
* @see http://www.wpquestions.com/question/showChronoLoggedIn/id/10370 | |
*/ | |
add_filter( 'pre_get_posts', 'wpq_pre_get_posts', 99 ); | |
function wpq_pre_get_posts( $query ) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example how to setup up multiple comment forms and comments lists | |
* | |
* @version 0.0.5 | |
* @file functions.php | |
* @see http://www.wpquestions.com/question/showLoggedIn/id/9749 | |
*/ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WooCommerce - Search by product dimensions, pa_colour and SKU | |
* Description: Shortcodes [wpq_search] and [wpq_results] to search products by length, height, width, attribute colour taxonomy and SKU | |
* Plugin URI: http://www.wpquestions.com/question/showChronoLoggedIn/id/9732 | |
* Author: dbranes | |
* Version: 0.2.1 | |
*/ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Multi upload field - Insert images into WP media library and link them to post ID | |
add_action( 'gform_after_submission_20', 'my_add_post_attachements', 10, 2 ); | |
function my_add_post_attachements( $entry, $form ) | |
{ | |
$submit = array(); | |
$submit = $entry["38"]; //The field ID of the multi upload |