Getting started:
Related tutorials:
| <?php | |
| namespace App\Modules\Admin\Middleware; | |
| // First copy this file into your middleware directoy | |
| use Closure; | |
| class CheckRole { | |
| /** |
| <?php namespace App\Modules; | |
| class ServiceProvider extends \Illuminate\Support\ServiceProvider | |
| { | |
| public function boot() | |
| { | |
| $modules = config("module.modules"); | |
| while (list(,$module) = each($modules)) { | |
| if(file_exists(__DIR__.'/'.$module.'/routes.php')) { | |
| include __DIR__.'/'.$module.'/routes.php'; |
| SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(wp_posts.post_title, ' ', 1), ' ', -1) as memberfirst, | |
| SUBSTRING_INDEX(SUBSTRING_INDEX(wp_posts.post_title, ' ', 2), ' ', -1) as memberlast, | |
| wp_postmeta.meta_value | |
| FROM wp_posts, wp_postmeta | |
| WHERE wp_posts.ID = wp_postmeta.post_id | |
| AND wp_posts.post_type = 'member' | |
| AND wp_posts.post_status = 'publish' | |
| AND wp_postmeta.meta_key = 'email' | |
| AND wp_postmeta.meta_value != '' | |
| ORDER BY wp_posts.post_date DESC |
| <?php | |
| /* file: wp-content/plugins/the-events-calendar/src/Tribe/Main.php */ | |
| /** | |
| * Main Tribe Events Calendar class. | |
| */ | |
| // Don't load directly | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| die( '-1' ); | |
| } |
| // Override the woocommerce default filter for getting max price for filter widget. | |
| add_filter( 'woocommerce_price_filter_widget_max_amount', 'theme_woocommerce_price_filter_widget_max_amount', 10, 2 ); | |
| /** | |
| * Fix max_price issue in price filter widget. | |
| * | |
| * @param int $max_price The price filter form max_price. | |
| * @return int Max price for the filter. | |
| */ | |
| function theme_woocommerce_price_filter_widget_max_amount( $max_price ) { |
| -- Not a pretty approach but this will help you get a listing of all active plugins | |
| DROP TABLE | |
| IF EXISTS wp_active_plugins; | |
| CREATE TEMPORARY TABLE wp_active_plugins (plugin_file VARCHAR(150)); | |
| ALTER TABLE wp_active_plugins ADD UNIQUE INDEX ix_plugin (plugin_file); | |
| INSERT IGNORE | |
| INTO wp_active_plugins |
| SELECT | |
| u.ID AS id, | |
| u.user_login AS login_name, | |
| first_name.meta_value AS first_name, | |
| last_name.meta_value AS last_name, | |
| LOWER(u.user_email) AS email, | |
| created_ip.meta_value AS created_ip, | |
| u.user_registered AS created_at | |
| FROM | |
| wp_users u |
Getting started:
Related tutorials:
| /* | |
| AjaxHook.js - A simple utility library for intercepting Ajax calls. | |
| This may be useful to inject simple interceptors to analyze pr capture Ajax traffic and may be even useful for automation tests to determine when an Ajax response returns. | |
| To use : | |
| 1>Create a new AjaxHook object | |
| var hook = new AjaxHook(); |
| // Create our server | |
| var server; | |
| server = http.createServer(function(req,res){ | |
| // Set CORS headers | |
| res.setHeader('Access-Control-Allow-Origin', '*'); | |
| res.setHeader('Access-Control-Request-Method', '*'); | |
| res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET'); | |
| res.setHeader('Access-Control-Allow-Headers', '*'); | |
| if ( req.method === 'OPTIONS' ) { | |
| res.writeHead(200); |