Skip to content

Instantly share code, notes, and snippets.

@asadowski10
asadowski10 / beapi-searchwp.php
Created May 16, 2019
Deactive Search WP on AJAX P2P search query
View beapi-searchwp.php
<?php
/*
Plugin Name: Be API - Search WP
Plugin URI: http://www.beapi.fr
Description: Deactive Search WP on AJAX P2P search query
Author: BeAPI
Author URI: http://www.beapi.fr
Version: 1.0.0
*/
@asadowski10
asadowski10 / acf-relationship-the-event-calendar.php
Last active May 22, 2019
Advanced Custom Fields -Relationship & The Event Calendar past events
View acf-relationship-the-event-calendar.php
<?php
add_filter( 'acf/fields/relationship/query/key=field_59006ee8b9a7b', 'bea_acf_relationship' ), 10, 3 );
/**
*
* Display all events in Relationship field ( future, past )
*
* @param $args
* @param $field
* @param $object_id
@asadowski10
asadowski10 / media-vault-wp-editor.php
Created Aug 11, 2017
Protect media uploaded with content editor
View media-vault-wp-editor.php
<?php
/**
* Plugin Name: BE API - Media Vault protect media from editor
* Description: Allow to protect media uploaded with content editor
* Plugin URI: http://www.beapi.fr
* Version: 1.0.0
* Author: BeAPI
* Author URI: http://www.beapi.fr
*/
@asadowski10
asadowski10 / fix-conflict-js-composer-yoast.php
Created Mar 16, 2017
Fix Conflict between Yoast SEO and VC Grid Builder
View fix-conflict-js-composer-yoast.php
<?php
/**
* @source : https://github.com/Yoast/wordpress-seo/issues/6219
**/
add_action( 'vc_backend_editor_render', 'bea_fix_conflict', 9999 );
function bea_fix_conflict() {
wp_dequeue_script( 'vc_vendor_yoast_js' );
if ( wp_script_is( 'yoast-seo-post-scraper' ) ) {
@asadowski10
asadowski10 / tools.php
Last active Oct 14, 2016
Remove all WordPress Customers - CLI Tools
View tools.php
<?php
if ( php_sapi_name() !== 'cli' || isset( $_SERVER['REMOTE_ADDR'] ) ) {
die( 'CLI Only' );
}
// Get first arg
if ( ! isset( $argv ) || count( $argv ) < 2 ) {
echo "Missing parameters.\n";
echo "script usage: php tools.php [domain]\n";
die();
@asadowski10
asadowski10 / remove_wp_meta_seo_filter.php
Created Aug 19, 2016
Remove filter of WP Meta SEO to no generate all images sizes on admin upload
View remove_wp_meta_seo_filter.php
<?php
if ( is_admin() && class_exists( 'MetaSeo_Image_List_Table' ) ) {
remove_filter( 'image_size_names_choose', array(
'MetaSeo_Image_List_Table',
'add_more_attachment_sizes_choose'
), 10, 1 );
}
@asadowski10
asadowski10 / metaboxes-taxonomy-order.php
Last active Aug 29, 2015
Change taxonomy order in admin metabox by name
View metaboxes-taxonomy-order.php
<?php
/*
Plugin Name: Metaboxes taxonomy order
Description: Change taxonomy order in admin metabox by name
Plugin URI: http://www.beapi.fr
Version: 1.0
Author: BeAPI
Author URI: http://www.beapi.fr
/*