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
| "require-dev": { | |
| "phpunit/phpunit": "^7.0", | |
| "roots/wordpress": "^5.5", | |
| "wp-phpunit/wp-phpunit": "^5.0", | |
| "symfony/var-dumper": "4.*", | |
| "phpstan/phpstan": "^0.12.6", | |
| "szepeviktor/phpstan-wordpress": "^0.7.2", | |
| "php-stubs/wordpress-stubs": "^5.6.0", |
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 declare(strict_types=1); | |
| namespace Perique\Loader; | |
| /** | |
| * Wordpress Script and Style enqueuing class. | |
| * | |
| * @author Glynn Quelch <glynn.quelch@gmail.com> | |
| */ | |
| class Enqueue { |
This file has been truncated, but you can view the full file.
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
| -- phpMyAdmin SQL Dump | |
| -- version 4.6.6deb5 | |
| -- https://www.phpmyadmin.net/ | |
| -- | |
| -- Host: localhost:3306 | |
| -- Generation Time: Aug 07, 2019 at 01:12 PM | |
| -- Server version: 5.7.26-0ubuntu0.18.10.1 | |
| -- PHP Version: 7.2.17-0ubuntu0.18.10.1 | |
| SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
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
| /** | |
| * Sets a new password and returns a bool if changed. | |
| * | |
| * @param integer $user_id The users id | |
| * @param string $new_password The users new password | |
| * @return bool Returns true/false if password set. | |
| */ | |
| function gq_set_new_password( int $user_id, string $new_password ): bool { | |
| // Update the password. |
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
| /** | |
| * Order History controller. | |
| * Used to show the order histoy on daily and monthly routes. | |
| */ | |
| dipt_app.controller('replenishment_controller', ['$scope', '$routeParams', '$timeout', '$q', '$location', '$mdToast', '$window', '$mdSidenav', '$mdDialog', 'dipt_app_action', | |
| function ($scope, $routeParams, $timeout, $q, $location, $mdToast, $window, $mdSidenav, $mdDialog, dipt_app_action) { | |
| // Init vars. | |
| $scope.page_title = 'DIPT WebApp'; | |
| // The factory data object. | |
| $scope.factory_data = { |
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
| SELECT p.ID AS product, p.post_name, t.name, tt.parent, t.term_id, pm.meta_value AS price | |
| FROM wp_posts AS p | |
| INNER JOIN wp_postmeta AS pm ON (p.ID = pm.post_id AND pm.meta_key = '_price' ) | |
| INNER JOIN wp_term_relationships AS tr ON ('p.ID' = tr.object_id) | |
| INNER JOIN wp_term_taxonomy AS tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) | |
| INNER JOIN wp_terms AS t ON (t.term_id = tt.term_id AND t.term_id = 63) | |
| WHERE p.post_status = 'publish' | |
| AND p.post_type = 'product' OR 'product_variation' | |
| AND tt.taxonomy = 'product_cat' | |
| ORDER BY p.ID DESC |
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 | |
| //After Submission hook & function | |
| add_action("gform_after_submission", "after_submission", 10, 2); | |
| function after_submission($entry, $form){ | |
| //For this example, i was creating a simple post (of course it can be used for anything from complex woocommerce production creation to user registration. | |
| $my_post = array( | |
| 'post_title' => wp_strip_all_tags( 'test' ), |
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
| function variable_excerpt($text, $length, $url = ''){ | |
| $clean = strip_tags($text); | |
| echo substr($clean,0,$length); | |
| if (strlen($clean) > $length) { | |
| if ($url !== '') { | |
| echo '...<span class="variable-excerpt-readmore"><a href="'.get_the_permalink($url).'">continue reading</a></span>'; | |
| } else { | |
| echo '...<span class="variable-excerpt-readmore">continue reading</span>'; | |
| } | |
| } |