This file contains 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
function getURLParameter(name) { | |
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null | |
} |
This file contains 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
sprintf( __( '%1$s ago', 'example' ), human_time_diff( strtotime( $post->post_date ), current_time('timestamp') ) ); |
This file contains 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
if( class_exists( 'AppPresser' ) && AppPresser::is_app() ) { | |
add_filter('wptouch_should_init_pro', '__return_false'); | |
} |
This file contains 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
class BP_MEDIA_LIBRARY_FILTER { | |
/** | |
* Defines media types | |
* @var array | |
*/ | |
protected static $media_types = array(); | |
/** | |
* Holds a singleton instance of this class | |
* @var null |
This file contains 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 | |
// this is to add a fake component to BuddyPress. A registered component is needed to add notifications | |
function custom_filter_notifications_get_registered_components( $component_names = array() ) { | |
// Force $component_names to be an array | |
if ( ! is_array( $component_names ) ) { | |
$component_names = array(); | |
} | |
// Add 'custom' component to registered components array |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
vagrant_dir = File.expand_path(File.dirname(__FILE__)) | |
Vagrant.configure("2") do |config| | |
# Store the current version of Vagrant for use in conditionals when dealing | |
# with possible backward compatible issues. | |
vagrant_version = Vagrant::VERSION.sub(/^v/, '') |
This file contains 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 | |
/** | |
* This function will see if a PDF or other "attachment" post-type returned by SearchWP | |
* is present in a custom field in a regular post, and will return that post instead. Note | |
* this will only process documents which are referenced via the "attachment" post type. | |
* | |
* For example, you may have a product specification PDF and would like it in the search | |
* results, but would rather people got to it by visiting the product page itself. | |
* |
This file contains 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
function page_builder_remove_editor_init() { | |
// If not in the admin, return. | |
if ( ! is_admin() ) { | |
return; | |
} | |
// Get the post ID on edit post with filter_input super global inspection. | |
$current_post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT ); | |
// Get the post ID on update post with filter_input super global inspection. | |
$update_post_id = filter_input( INPUT_POST, 'post_ID', FILTER_SANITIZE_NUMBER_INT ); |
This file contains 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
function wpsd_add_events_args() { | |
global $wp_post_types; | |
$wp_post_types['incsub_wiki']->show_in_rest = true; | |
$wp_post_types['incsub_wiki']->rest_base = 'wiki'; | |
$wp_post_types['incsub_wiki']->rest_controller_class = 'WP_REST_Posts_Controller'; | |
} | |
add_action( 'init', 'wpsd_add_events_args', 30 ); |
This file contains 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
function remove_bbp_setup_current_user_notice( $function, $message, $version ) { | |
if( 'bbp_setup_current_user' === $function ) { | |
return false; | |
} | |
} | |
add_action( 'doing_it_wrong_run', 'remove_bbp_setup_current_user_notice', 10, 3 ); |