Skip to content

Instantly share code, notes, and snippets.

View jmslbam's full-sized avatar
💭
Available for (WordPress) work

Jaime Martínez jmslbam

💭
Available for (WordPress) work
View GitHub Profile
@jmslbam
jmslbam / mlp_navigation_with_login.php
Last active February 11, 2016 12:45 — forked from thefuxia/mlp_navigation_with_login.php
function mlp_navigation_with_login()
<?php
// copy from here
/**
* Create a navigation like: DE | EN | RU | Log in
*
* @return string
*/
function mlp_navigation_with_login()
@jmslbam
jmslbam / composer.json
Last active May 24, 2017 07:32
Install Clarkson Core via Composer
{
"name": "clarkson/website",
"type": "project",
"license": "MIT",
"description": "Example to add Clarkson Core via Compser",
"repositories": [
{
"type": "git",
"url":"https://github.com/level-level/Clarkson-Core"
}
@jmslbam
jmslbam / vip-wp-cli.php
Last active February 10, 2017 11:14
WPCOM_VIP_CLI_Command
<?php
class WPCOM_VIP_CLI_Command extends WP_CLI_Command {
/**
* Clear all of the caches for memory management
*/
protected function stop_the_insanity() {
/**
* @var \WP_Object_Cache $wp_object_cache
@jmslbam
jmslbam / clarkson_event.php
Last active August 4, 2017 13:29
Clarkson Event Manager - WordPress Object overwrite example
<?php
use Clarkson\EventManager\Event;
// Which class do we need to initiate? new \XYZ?
add_filter('clarkson_event_manager_post_class', function(){
return '\Clarkson_Event';
}, 10, 0);
// Our custom WordPress object
class Clarkson_Event extends Event {
@jmslbam
jmslbam / elasticpress_posttype_weighting.php
Created December 2, 2020 16:40 — forked from TwistedTabby/elasticpress_posttype_weighting.php
weighting by post_type using ElasticPress
function SetSearchArgs( $formattedArgs, $args = [] ) {
if( isset( $args[ 'post_type' ] ) && ( count( $args[ 'post_type' ] ) > 1 || gettype( $args[ 'post_type' ] ) === 'string' ) ) {
if( gettype( $args[ 'post_type' ] ) === 'array' ) {
$existing_query = $formattedArgs[ 'query' ];
unset( $formattedArgs[ 'query' ] );