This file contains hidden or 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 | |
| // Add the following code snippet to the functions.php file of the active theme of your Child Site site. | |
| add_filter( 'mainwp-child-get-total-size', 'mycustom_mainwp_child_get_total_size', 10 , 1 ); | |
| function mycustom_mainwp_child_get_total_size( $value ) { | |
| return false; | |
| } | |
| ?> |
This file contains hidden or 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 | |
| // Add the following code snippet to the PHP section of the MainWP Custom Dashboard Extension | |
| add_filter('mainwp_file_uploader_allowed_file_types', 'mycustom_mainwp_file_uploader_allowed_file_types'); | |
| function mycustom_mainwp_file_uploader_allowed_file_types( $types ) { | |
| $types[] = 'htaccess'; | |
| return $types; | |
| } |
This file contains hidden or 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 | |
| // Add the following code snippet to the PHP section in the MainWP Custom Dashbaord plugin | |
| add_filter( 'mainwp_updatescheck_sendmail_at_time', 'mycustom_mainwp_updatescheck_sendmail_at_time', 10, 1 ); | |
| function myhook_mainwp_updatescheck_sendmail_at_time( $hour ) { | |
| $hour = '12:00'; // send email notifactions after 12:00 | |
| return $hour; | |
| } |
This file contains hidden or 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 | |
| // Use this snippet in the MainWP Code Snippets Extension (https://mainwp.com/extension/code-snippets/) | |
| // Snippet Type: This Code Snippet only returns information from Child Site | |
| if ( function_exists( 'sg_cachepress_purge_cache' ) ) { | |
| sg_cachepress_purge_cache(); | |
| echo "Cache cleared successfully!"; | |
| } else { | |
| echo "Clearing cache failed!"; |
This file contains hidden or 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 | |
| // Add the following code snippet to the functions.php file of the MainWP Customisations plugin | |
| // Download MainWP Customisations here: https://github.com/mainwp/mainwp-customisations | |
| // More about the plugin: https://mainwp.com/mainwp-customisations/ | |
| add_filter( 'mainwp_open_hide_referrer', 'myhook_mainwp_open_hide_referrer'); | |
| function myhook_mainwp_open_hide_referrer() { | |
| return true; | |
| } |
This file contains hidden or 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 | |
| // Add the following code snippet to the functions.php file of the MainWP Customisations plugin | |
| // Download MainWP Customisations here: https://github.com/mainwp/mainwp-customisations | |
| // More about the plugin: https://mainwp.com/mainwp-customisations/ | |
| add_filter( 'mainwp_codesnippets_editor_attr', 'myhook_mainwp_codesnippets_editor_attr', 10); | |
| function myhook_mainwp_codesnippets_editor_attr( $data ) { | |
| $data['height'] = 500; | |
| // supported themes: 'erlang-dark', 'night', 'xq-dark', 'xq-light', 'the-matrix', 'eclipse' |
This file contains hidden or 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 | |
| // Hide custom branidng for the user with specific ID | |
| // Replace ID with actual ID number | |
| add_filter( 'mainwp_child_branding_init_options', 'mycustom_mainwp_child_branding_init_options' ); | |
| function mycustom_mainwp_child_branding_init_options( $option ) { | |
| $current_user_id = get_current_user_id(); | |
| if ( $current_user_id == 'ID' && is_array( $option ) && isset( $option[ 'cancelled_branding' ] ) ) { | |
| $option[ 'cancelled_branding' ] = true; |
This file contains hidden or 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 | |
| // Add the following code snippet to the PHP section of the MainWP Custom Dashboard Extension, | |
| // or the functions.php file of the active theme on your Dashboard site. | |
| add_filter( 'mainwp_comments_widget_limit_string', 'mycustom_mainwp_comments_widget_limit_string', 10, 1 ); | |
| function mycustom_mainwp_comments_widget_limit_string( $length = false ) { | |
| return 99999; | |
| } |