View functions.php
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
add_action('wp_head', 'show_template'); | |
function show_template() { | |
global $template; | |
echo basename($template); | |
} |
View test
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
{ | |
"data": { | |
"reviewer": [ | |
{ | |
"id": 1, | |
"name": "susan smith", | |
"job": "web developer", | |
"text": "I'm baby meggings twee health goth +1. Bicycle rights tumeric chartreuse before they sold out chambray pop-up. Shaman humblebrag pickled coloring book salvia hoodie, cold-pressed four dollar toast everyday carry" | |
}, | |
{ |
View starter_gutenberg_theme.php
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
// Add custom editor font sizes. | |
add_theme_support( | |
'editor-font-sizes', | |
array( | |
array( | |
'name' => __( 'Smallest', 'dariobf' ), | |
'shortName' => __( 'XXS', 'dariobf' ), | |
'size' => '.625rem', | |
'slug' => 'smallest', | |
), |
View script.js
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
/** * Completely Remove jQuery From WordPress */ | |
function my_init() { | |
if ( ! is_admin() ) { | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', false ); | |
} | |
} | |
add_action( 'init', 'my_init' ); | |
/** * Completely Remove jQuery From WordPress Admin Dashboard */ | |
add_action( 'wp_enqueue_scripts', 'no_more_jquery' ); |
View comments-content.php
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
/** | |
* Adds comments just before content, nothing between them | |
*/ | |
add_filter( 'the_content', 'bf_comments_content', 10); | |
function bf_comments_content( $content) { | |
if( is_single() && comments_open() ) { | |
ob_start(); | |
comments_template(); | |
$comments = ob_get_contents(); | |
ob_end_clean(); |
View whatever.sh
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
To disable: | |
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false | |
defaults write -g NSScrollAnimationEnabled -bool false | |
defaults write -g NSWindowResizeTime -float 0.001 | |
defaults write -g QLPanelAnimationDuration -float 0 | |
defaults write -g NSScrollViewRubberbanding -bool false | |
defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false | |
defaults write -g NSToolbarFullScreenAnimationDuration -float 0 | |
defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0 | |
defaults write com.apple.dock autohide-time-modifier -float 0 |
View convuls_customquery.php
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 convuls_customquery(){ | |
// Set the arguments based on our get parameters | |
$today = date('Ymd',strtotime('today')); | |
$args = array ( | |
'post_type' => 'evento', | |
'posts_per_page' => -1, | |
'meta_key' => 'fecha', | |
'meta_query' => array( | |
'event_selected' =>array( |
View custom-rest-route.php
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 | |
// Registramos una ruta nueva para la rest api | |
add_action( 'rest_api_init', function () { | |
register_rest_route( 'convulsio/v2', '/convulsio-events/', | |
array( | |
'methods' => 'GET', | |
'callback' => 'convuls_customquery' | |
) | |
); | |
}); |
View FacetWP cool pager
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
/* | |
* FacetWP Pagination | |
* You should print it with `echo facetwp_display( 'pager' );` if you prefer that to shortcode method | |
*/ | |
function bf_custom_paginator_facetwp( $output, $params ) { | |
$output = ''; | |
$page = (int) $params['page']; | |
$total_pages = (int) $params['total_pages']; |
View Limitar la creación de términos de taxonomía por rol de usuario
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
add_action( 'pre_insert_term', function ( $term, $taxonomy ) | |
{ | |
return ( 'tutaxonomia' === $taxonomy && !current_user_can( 'manage_options' ) ) | |
? new WP_Error( 'term_addition_blocked', __( 'No puedes añadir términos a esta taxonomía.' ) ) | |
: $term; | |
}, 0, 2 ); |
NewerOlder