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 | |
namespace GM\VirtualPages; | |
/** | |
* @author Giuseppe Mazzapica <[email protected]> | |
* @license http://opensource.org/licenses/MIT MIT | |
*/ | |
class Controller implements ControllerInterface { | |
private $pages; |
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
// filter relevanssi based on job_region query | |
add_filter('relevanssi_modify_wp_query', 'region_tax_query'); | |
function region_tax_query($query) { | |
$tax_query = array(); | |
if (!empty($query->query_vars['job_region'])) { | |
$tax_query[] = array( | |
'taxonomy' => 'region', | |
'field' => 'id', | |
'terms' => $query->query_vars['job_region'] |
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 | |
define( 'DOING_AJAX', true ); | |
define( 'WP_ADMIN', true ); | |
define( 'WP_IMPORTING', true ); | |
$err = array(); | |
/** Load WordPress Bootstrap */ | |
require_once '../../../../wp-load.php'; |
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
#!/bin/bash | |
# Default options | |
LOCALE="fr_FR" | |
DB_HOST='localhost' | |
VIRUSTOTAL_KEY='YOUR_KEY' | |
printf "Name of the project? cf My Project: " | |
read PROJECT_NAME |
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 | |
/** | |
* Retrieve a page given its slug. | |
* | |
* @global wpdb $wpdb WordPress database abstraction object. | |
* | |
* @param string $page_slug Page slug | |
* @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A. | |
* Default OBJECT. | |
* @param string|array $post_type Optional. Post type or array of post types. Default 'page'. |
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 | |
require_once("wp-load.php"); | |
add_action('http_api_debug', 'test_http_api_debug', 10, 5); | |
add_filter('oembed_remote_get_args', 'test_oembed_remote_get_args', 10, 2); | |
add_filter('oembed_fetch_url', 'test_oembed_fetch_url', 10, 3); | |
$embed_code = wp_oembed_get('http://vimeo.com/75343493'); |
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 | |
/* | |
* If you already have something in your functions.php, please remove these first few lines | |
*/ | |
// Usage tribe_is_past_event( $event_id ) | |
function tribe_is_past_event( $event = null ){ | |
if ( ! tribe_is_event( $event ) ){ | |
return false; | |
} | |
$event = tribe_events_get_event( $event ); |
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 | |
/** | |
* Woocommerce Custom Variation Output | |
* | |
* The following function allow for the theme to display product variations in a grid format. | |
* This code could be moved to a plugin but is in the theme function file as it used the | |
* themes grid system. | |
* | |
* @package WooGrid | |
* @since WooGrid 1.2 |
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
new WP_Error( $code, $message ); | |
new WP_Error( $code, $message, array( 'status' => 400 ) ); | |
new WP_Error( $code, __( 'Invalid existing meta data for action.' ), array( 'status' => 400 ) ); | |
new WP_Error( $code, __( 'Invalid provided meta data for action.' ), array( 'status' => 400 ) ); | |
new WP_Error( 'forbidden', 'You are not allowed to do this', array( 'status' => 403 ) ); | |
new WP_Error( 'invalid-method', __( 'Method not implemented. Must be over-ridden in subclass.' ), array( 'status' => 405 ) ); | |
new WP_Error( 'json_missing_callback_param', sprintf( __( 'Missing parameter %s' ), $param->getName() ), array( 'status' => 400 ) ); | |
new WP_Error( 'rest_already_deleted', __( 'The post has already been deleted.' ), array( 'status' => 410 ) ); | |
new WP_Error( 'rest_cannot_assign_sticky', __( 'You do not have permission to make posts sticky.' ), array( 'status' => 403 ) ); | |
new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to post on this site.' ), array( 'status' => 400 ) ); |