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 | |
| // My new order statuses. | |
| function register_my_new_order_statuses() { | |
| register_post_status( 'wc-status-name', array( | |
| 'label' => _x( 'Status Name', 'Order status', 'textdomain' ), | |
| 'public' => true, | |
| 'exclude_from_search' => false, | |
| 'show_in_admin_all_list' => true, | |
| 'show_in_admin_status_list' => 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
| <?xml version="1.0"?> | |
| <ruleset name="phpmd.xml" | |
| xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | |
| xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
| <description>PHPMD Ruleset for a WordPress Theme</description> | |
| <rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" /> | |
| <rule ref="rulesets/cleancode.xml/ElseExpression" /> | |
| <rule ref="rulesets/cleancode.xml/StaticAccess" /> |
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 | |
| /** | |
| * Get the file size of any remote resource (using get_headers()), | |
| * either in bytes or - default - as human-readable formatted string. | |
| * | |
| * @author Stephan Schmitz <eyecatchup@gmail.com> | |
| * @license MIT <http://eyecatchup.mit-license.org/> | |
| * @url <https://gist.github.com/eyecatchup/f26300ffd7e50a92bc4d> | |
| * | |
| * @param string $url Takes the remote object's URL. |
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
| $('.tooltip').tooltipster({ | |
| functionBefore: function(origin, continueTooltip){ | |
| continueTooltip(); | |
| var color = origin.data('color'); | |
| if(!color){ return false; } | |
| $('.tooltipster-default').css({ | |
| 'background-color': color | |
| }); |
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
| // Remove Access to the course linked to the subscription key | |
| function remove_course_access( $user_id, $subscription_key ) { | |
| // Get the course ID related to the subscription | |
| $subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key ); | |
| $courses_id = get_post_meta($subscription['product_id'], '_related_course', true); | |
| // Update access to the courses | |
| if ($courses_id && is_array($courses_id)) { | |
| foreach ($courses_id as $course_id) { |
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
| Add to something like functions.php | |
| // https://www.skyverge.com/blog/down-the-rabbit-hole-wordpress-and-timezones/ | |
| function wp_get_timezone_string() { | |
| // if site timezone string exists, return it | |
| if ( $timezone = get_option( 'timezone_string' ) ) | |
| return $timezone; | |
| // get UTC offset, if it isn't set then return UTC |
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 | |
| /* set the url of the file to sideload - probably be from $_POST or something */ | |
| $url = 'http://domain.com/image.jpg'; | |
| /** | |
| * donwload the url into wordpress | |
| * saved temporarly for now | |
| */ | |
| $tmp = download_url( $url ); |
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
| { | |
| "name": "shelob9/router-experiment", | |
| "require": { | |
| "silex/silex": "~1.3", | |
| "twig/twig": "^2.0@dev" | |
| }, | |
| "minimum-stability": "dev", | |
| "autoload": { | |
| "psr-4": { | |
| "shelob9\\router\\": "src" |
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
| // check Polylang exist | |
| if ( function_exists('pll_register_string') ) { | |
| $icelock_title_portfolio_section = get_theme_mod('icelock_title_portfolio_section', ''); | |
| pll_register_string('Portfolio Section Title', $icelock_title_portfolio_section); | |
| $icelock_title_team_section = get_theme_mod('icelock_title_team_section', ''); | |
| pll_register_string('Team Section Title', $icelock_title_team_section); | |
| $icelock_title_recent_post_section = get_theme_mod('icelock_title_recent_post_section', ''); | |
| pll_register_string('Recent Post Section Title', $icelock_title_recent_post_section); | |
| $icelock_title_testimonials_section = get_theme_mod('icelock_title_testimonials_section', ''); | |
| pll_register_string('Testimonial Section Title', $icelock_title_testimonials_section); |
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
| development: | |
| adapter: mysql2 | |
| encoding: utf8 | |
| database: my_database | |
| username: root | |
| roles: | |
| - admin | |
| - developer | |
| - guest | |
| password: |