Skip to content

Instantly share code, notes, and snippets.

View harkor's full-sized avatar

harkor

View GitHub Profile
__ __ __ __
\ V\ V\ V / Varying Vagrant Vagrants
\_/\_/\_/ v2.4.0-git::master
Platform: linux-gnu shell:/bin/zshsystemd CaseSensitiveFS
Vagrant: 2.2.2
VirtualBox: 5.2.22r126257
Docs: https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
<?php
class MyMetaBox {
function __construct(){
add_filter('rwmb_meta_boxes', array(&$this, 'my_meta_box'));
add_action('wp_ajax_get_options', array(&$this, 'get_options'));
}
<?php
class MyMetaBox {
function __construct(){
add_filter('rwmb_meta_boxes', array(&$this, 'my_meta_box'));
add_action('wp_ajax_get_options', array(&$this, 'get_options'));
}
<?php
class MyMetaBox {
function __construct(){
add_filter('rwmb_meta_boxes', array(&$this, 'my_meta_box'));
}
@harkor
harkor / MetaBoxClass.php
Created February 25, 2021 12:39
MetaBox Select Advanced Ajax
<?php
class MetaBoxClass {
function __construct(){
// Set MetaBox
add_filter('rwmb_meta_boxes', array(&$this, 'my_meta_box'));
// Add new field type
@harkor
harkor / rwmb-copy-group.js
Created April 8, 2021 10:31
Copy Button for groups Metabox
jQuery(function($){
setTimeout(function(){
$('.rwmb-clone').each(function(){
var $this = $(this);
$this.prepend('<a href="#" class="rwmb-button copy-clone"><span class="dashicons dashicons-controls-repeat"></span></a>');
});
}, 500);
});
( function( $, _, document, window, rwmb, i18n ) {
@harkor
harkor / fixCategorySlugForLanguages.php
Created August 6, 2021 11:00
Fix 404 error WPML - Slug with %custom_taxonomy% in rewrite slug
/**
* To make it work you need :
* 1 - Set a translation in WPML for the custom post type
* 2 - flush permalinks
*/
// Example custom post type snippet
add_action('init', function(){
// Register Custom Post type