Skip to content

Instantly share code, notes, and snippets.

<?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:24c9ba4a9baab4f24af7b4519febc731
Created February 16, 2023 15:53
WordCamp sponsor page, MotoPress
At <a href="https://motopress.com/">MotoPress</a>, our passion is to help businesses grow by delivering intuitive and scalable products for WordPress websites. With our roots firmly planted in WordPress, we’re poised to bring transparency, power, and security to the web.
Since 2013, we’ve been using our combined expertise as engineers, designers, writers, and support & marketing specialists to create innovative solutions for multiple businesses. You've probably heard of us as a developer of free solutions, Getwid WordPress blocks and MotoPress booking plugins, which are top favorites among our clients.
We've been building plugins and themes for various niches that we're passionate about. Whether you're a non-technical user or a developer creating client websites, MotoPress products are designed to help you achieve your goals.
<ul>
<li>We’ve been helping the <a href="https://motopress.com/products/category/hotel-booking-addons/">hotel industry</a>. Property owners can solely rely on our dedicated collectio
@mototeam
mototeam / getwid-add-custom-fonts.js
Last active March 4, 2021 09:28
An example of how to add custom fonts to Getwid Blocks.
// 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 April 8, 2020 14:49
An example of how to prevent all or specific styles from loading on the pages of your WordPress blog.
<?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 March 9, 2020 12:54
This plugin allows you to add registered user to a new Sandbox.
<?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
@mototeam
mototeam / gist:9137cef5ace249833ce462b4bbb6ec0a
Created June 14, 2017 08:01
motopress content editor - dequeue styles
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 June 8, 2015 14:18
MotoPress Visual Controls Example
<?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 June 8, 2015 12:58
MotoPress Nested Shortcodes Example
<?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 March 11, 2015 13:03
Removing all objects example
// 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 August 29, 2015 14:16
MotoPress Copyright Proof Fix plugin
<?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/
*/