Skip to content

Instantly share code, notes, and snippets.

add_filter('manage_webinar_posts_columns', 'columns_head');
add_action('manage_webinar_posts_custom_column', 'columns_content', 10, 2);
function columns_head($defaults) {
$defaults['miniature'] = 'Miniature';
$defaults['date_du_webinaire'] = 'Date du webinaire';
unset($defaults['date'] );
return $defaults;
add_filter( 'excerpt_length', function($length) {
return 20;
} );
// remove continue text on excerpt
function custom_excerpt_more($more) {
global $post;
// $more_text = '...';
return '…';
function categoryListing($taxonomy, $orderby, $order) {
$term_args = array(
'orderby' => $orderby,
'order' => $order,
'hide_empty' => true,
);
$terms = get_terms($taxonomy,$term_args);
if ($terms) {
.text-stabilo{
margin: 0 -0.4em;
padding: 0.1em 0.4em;
border-radius: 0.8em 0.3em;
background: transparent;
background-image: linear-gradient(to right, rgba(255, 225, 0, 0.1), rgba(255, 225, 0, 0.7) 4%, rgba(255, 225, 0, 0.3));
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
display: inline-block;
}
https://github.com/bgrins/TinyColor
// Modification Functions
// ----------------------
// Thanks to less.js for some of the basics here
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
function desaturate(color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var hsl = tinycolor(color).toHsl();
hsl.s -= amount / 100;
@annelyse
annelyse / click
Created June 18, 2021 10:05
Selectionner un element apres qu'il ai été crée en js appen cibler le document et pas l'élément directement
$(document).on('click','.tooltip-close',function(){
//your code here
alert('test');
});
document.addEventListener('click', function (e) {
if (e.target.className === 'tooltip-close') {
e.target.parentElement.remove();
}
}, false);
<?php
/**
* Templates and Page IDs without editor
*
*/
function ea_disable_editor( $id = false ) {
$excluded_templates = array(
// 'templates/contact.php'
);
<?php /**
* Set Advanced Custom Fields metabox priority.
*
* @param string $priority The metabox priority.
* @param array $field_group The field group data.
* @return string $priority The metabox priority, modified.
*/
function km_set_acf_metabox_priority( $priority, $field_group ) {
if ( 'group_60c878bd5b81f' === $field_group['key'] ) {
<?php
add_action( 'rest_api_init', 'slug_register_acf' );
function slug_register_acf() {
$post_types = get_post_types(['public'=>true], 'names');
foreach ($post_types as $type) {
register_rest_field( $type,
'acf',
array(
'get_callback' => 'slug_get_acf',