Skip to content

Instantly share code, notes, and snippets.

View asadowski10's full-sized avatar

Alexandre Sadowski asadowski10

View GitHub Profile
@asadowski10
asadowski10 / metaboxes-taxonomy-order.php
Last active August 29, 2015 14:08
Change taxonomy order in admin metabox by name
<?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
/*
@asadowski10
asadowski10 / remove_wp_meta_seo_filter.php
Created August 19, 2016 13:38
Remove filter of WP Meta SEO to no generate all images sizes on admin upload
<?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 / tools.php
Last active October 14, 2016 12:59
Remove all WordPress Customers - CLI Tools
<?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 / fix-conflict-js-composer-yoast.php
Created March 16, 2017 16:44
Fix Conflict between Yoast SEO and VC Grid Builder
<?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 / media-vault-wp-editor.php
Created August 11, 2017 13:30
Protect media uploaded with content editor
<?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 / acf-relationship-the-event-calendar.php
Last active August 17, 2022 15:00
Advanced Custom Fields -Relationship & The Event Calendar past events
<?php
add_filter( 'acf/fields/relationship/query/key=field_59006ee8b9a7b', 'bea_acf_relationship', 10, 3 );
add_filter( 'acf/load_value/name=featured_event', 'bea_acf_relationship', 10, 3 );
/**
*
* Display all events in Relationship field ( future, past )
*
* @param $args
* @param $field
@asadowski10
asadowski10 / beapi-searchwp.php
Created May 16, 2019 13:34
Deactive Search WP on AJAX P2P search query
<?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 / p2p-not-related.php
Last active May 24, 2021 10:08
Get not related Posts to Posts objects