Skip to content

Instantly share code, notes, and snippets.

View MaximeCulea's full-sized avatar
🇨🇭
New life begining.

Maxime CULEA MaximeCulea

🇨🇭
New life begining.
View GitHub Profile
@MaximeCulea
MaximeCulea / beapi-searchwp.php
Created May 16, 2019 14:11 — forked from asadowski10/beapi-searchwp.php
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
*/
@MaximeCulea
MaximeCulea / required-excerpt.php
Last active June 6, 2020 21:32 — forked from microneer/gist:abe764ae031e88c5b0919b661a0c8ff9
Make post excerpt as mandatory field with capability to set the lenght, if needed.
// put this in functions.php or in your custom plugin or theme code.
$m = new Mandatory_Excerpt();
$m->add('post', 20 ); // will require all 'post' post types to have an excerpt at least 20 characters long
/**
* Helper class which removes specified metaboxes from specified pages. It manages setting up the hooks
* and calling them.
*
* @author: Michael Fielding
*

Installation

To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:

sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n

You don't have to put the library in /usr/lib/wpi18n, but if you don't put it there, make sure to set the $WP_I18N_LIB environment variable in your .bashrc or .bash_profile file (with no trailing slash):

export WP_I18N_LIB="/path/to/i18n/lib"

@MaximeCulea
MaximeCulea / install-all-languages.sh
Created March 16, 2017 22:49 — forked from johnbillion/install-all-languages.sh
Install all available languages on a WordPress site with WP-CLI
wp core language list --field=language | xargs -n 1 wp core language install