- httos://www.flyingweb.ie
- in/davidedelgatto
- @davidedelgatto
- davidedelgatto
- https://peerlist.io/davidedelgatto
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 | |
| //Create an admin user | |
| function fws_temp_admin_user(){ | |
| $username = 'superadmin'; //change this username | |
| $password = 'temp_wp_pwd'; // change this password | |
| $email = 'info@flyingweb.ie'; //change this email address | |
| //This will ensure it only tries to create the user once (based on email/username) |
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_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); | |
| function custom_excerpt_length( $length ) { | |
| return 20; // number of words. Default is 55. | |
| } | |
| ?> |
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 | |
| function mpr_get_expire_date() { | |
| if(is_user_logged_in()){ | |
| $user = MeprUtils::get_currentuserinfo(); | |
| $subscriptions = $user->active_product_subscriptions('transactions'); | |
| if(!empty($subscriptions)) { | |
| foreach($subscriptions as $s){ | |
| // Get Today Date | |
| $today = date("d-m-Y"); |
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 | |
| // Creation Websites | |
| // Add filter to change form '2' for Web Design prior to rendering | |
| add_filter("wsf_pre_render_2", "fws_create_websites", 10, 1); // <=== CHANGE THE FUNCTION NAME | |
| function fws_create_websites($form) { | |
| // Get MetaBox Custom Fields - Setting Page -- Master Pricing | |
| $setting_page = "master-pricing"; | |
| $field_name = "creation_services"; // <=== CHANGE ME WITH THE RIGHT CUSTOM FIELD ID (METABOX) |
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 a filter for WordPress Filter Hook data source to use | |
| add_filter( 'fws_get_addon_website_hook', 'fws_get_addon_website_callback', 10, 3 ); | |
| // My callback function for tag wsf_test_data_source_hook | |
| function fws_get_addon_website_callback( $data_grid, $field_id, $form_object ) { | |
| // Check field ID | |
| if( $field_id !== 137) { return $data_grid; } |
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
| { | |
| "TaxRate": { | |
| "Name": "RS", | |
| "Description": "VAT", | |
| "Active": true, | |
| "RateValue": 13.5, | |
| "AgencyRef": { | |
| "value": "1" | |
| }, | |
| "TaxReturnLineRef": { |
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 | |
| // Configuration - Users who can see everything and use the toggle | |
| $GLOBALS['usernames_to_not_hide'] = array('superadmin'); | |
| // Multiusers | |
| //$GLOBALS['usernames_to_not_hide'] = array('superuser1', 'superuser2'); | |
| // Update the pages_to_hide array | |
| $GLOBALS['pages_to_hide'] = array( | |
| 'index.php' => array('update-core.php'), |
