Skip to content

Instantly share code, notes, and snippets.

@mototeam
mototeam / getwid-add-custom-fonts.js
Last active Mar 4, 2021
An example of how to add custom fonts to Getwid Blocks.
View getwid-add-custom-fonts.js
// hook allows to disable Google Fonts
wp.hooks.addFilter('getwid.fontsControl.enableGoogleFonts', 'getwid', function (enabled) {
// current Google Fonts status(load or not) is passed to function as parameter
// should return true or false
// if return false - Google Fonts won't be loaded
return enabled;
});
// hook allows to filter lists of fonts and add custom
wp.hooks.addFilter('getwid.fontsControl.fonts', 'getwid', function (fonts) {
@mototeam
mototeam / getwid-dequeue-styles.php
Created Apr 8, 2020
An example of how to prevent all or specific styles from loading on the pages of your WordPress blog.
View getwid-dequeue-styles.php
<?php
/**
* The code below removes the loading of some assets
* needed for the Getwid blocks on frontend
*
* Uncomment the element of the array that you want
* to prevent from loading
*/
add_filter( 'getwid/blocks_style_css/dependencies', 'my_theme_dequeue_getwid_styles', 99 );
@mototeam
mototeam / motopress-demo-add-user-to-blog.php
Created Mar 9, 2020
This plugin allows you to add registered user to a new Sandbox.
View motopress-demo-add-user-to-blog.php
<?php
/*
* Plugin Name: MotoPress Demo - Add User to Sandbox
* Plugin URI: https://motopress.com
* Description: This plugin allows you to add registered user to a new Sandbox.
* Author: MotoPress
* Version: 1.0
* Author URI: https://motopress.com
* Network: True
View Add font with icons to Getwid plugin
<?php
/*
* Add font with icons to Getwid plugin.
* Use this code in functions.php or custom plugin.
*/
// add hook
add_action( 'getwid/icons-manager/init', 'my_theme_getwid_add_custom_icons' );
@mototeam
mototeam / gist:9137cef5ace249833ce462b4bbb6ec0a
Created Jun 14, 2017
motopress content editor - dequeue styles
View gist:9137cef5ace249833ce462b4bbb6ec0a
add_action( 'wp_print_styles', 'my_theme_wp_print_styles' );
function my_theme_wp_print_styles() {
if ( is_front_page() ) {
wp_dequeue_style('mpce-theme');
wp_dequeue_style('mpce-bootstrap-grid');
wp_dequeue_style('mpce-font-awesome');
}
}
@mototeam
mototeam / gist:d5bf1e7d6d6bf7dc0b5e
Created Jun 8, 2015
MotoPress Visual Controls Example
View gist:d5bf1e7d6d6bf7dc0b5e
<?php
/*
Plugin Name: MotoPress Visual Controls Example
Plugin URI: http://www.getmotopress.com/
Description: Example of the visual controls for object
Version: 1.0
Author: MotoPress
Author URI: http://www.getmotopress.com/
*/
@mototeam
mototeam / gist:c54efbc51aa126083479
Created Jun 8, 2015
MotoPress Nested Shortcodes Example
View gist:c54efbc51aa126083479
<?php
/*
Plugin Name: MotoPress Nested Shortcodes Example
Plugin URI: http://www.getmotopress.com/
Description: Example of the Nested Shortcodes in MotoPress Content Editor plugin
Version: 1.0
Author: MotoPress
Author URI: http://www.getmotopress.com/
*/
@mototeam
mototeam / gist:e659a8cb30165c73d1d1
Created Mar 11, 2015
Removing all objects example
View gist:e659a8cb30165c73d1d1
// mp_code & mp_text can be hidden only
$motopressCELibrary->getObject('mp_code')->setShow(false);
$motopressCELibrary->getObject('mp_text')->setShow(false);
$motopressCELibrary->removeObject('mp_heading');
$motopressCELibrary->removeObject('mp_image');
$motopressCELibrary->removeObject('mp_grid_gallery');
$motopressCELibrary->removeObject('mp_image_slider');
$motopressCELibrary->removeObject('mp_video');
$motopressCELibrary->removeObject('mp_space');
@mototeam
mototeam / gist:93aa797aefaf7f4ed3d1
Last active Aug 29, 2015
MotoPress Copyright Proof Fix plugin
View gist:93aa797aefaf7f4ed3d1
<?php
/*
Plugin Name: MotoPress Copyright Proof Fix
Plugin URI: http://www.getmotopress.com/
Description: Disable Copyright Proof plugin (frustrate_copy.js) in MotoPress visual editor
Version: 1.0
Author: MotoPress
Author URI: http://www.getmotopress.com/
*/
@mototeam
mototeam / gist:e8236f4109cf90a222a2
Created Feb 25, 2015
MotoPress PressTicket Fix plugin
View gist:e8236f4109cf90a222a2
<?php
/*
Plugin Name: MotoPress PressTicket Fix
Plugin URI: http://www.getmotopress.com/
Description: Fixes an issue with PressTicket plugin by Toan Nguyen http://wpoffice.net/contact/. PressTicket plugin adds custom div to each the_content filter call.
Version: 1.0
Author: MotoPress
Author URI: http://www.getmotopress.com/
*/