This file contains 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 | |
namespace App\Http\Api; | |
use Illuminate\Http\Request; | |
use App\Http\Controllers\Controller; | |
use Illuminate\Support\Facades\Auth; | |
use App\Models\User; | |
class ApiAuthController extends Controller |
This file contains 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 | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
if ( ! class_exists( 'WC_Process_Order_Email' ) ) : | |
/** | |
* Factory Completed Order Email | |
* | |
* An email sent to the factory when a new order is completed. | |
* |
This file contains 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_action( 'clean_post_cache', 'clean_qtranslatex_cache', 10, 2 ); | |
function clean_qtranslatex_cache( $post_id, $post) { | |
//depends on what language you have turn on for your site. | |
wp_cache_delete( $post_id, 'post_metazh' ); | |
} |
This file contains 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_action("gform_after_submission_1", "acf_post_submission", 10, 2); | |
function acf_post_submission ($entry, $form) | |
{ | |
$post_id = $entry["post_id"]; | |
update_field('address1', $entry['29.1'], $post_id); | |
update_field('address2', $entry['29.2'], $post_id); | |
update_field('address3', $entry['29.3'], $post_id); | |
} |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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_filter('pre_get_posts', 'pre_get_posts_hook' ); | |
function pre_get_posts_hook($wp_query) { | |
if (is_page()) | |
{ | |
$wp_query->set( 'orderby', 'title' ); | |
$wp_query->set( 'order', 'ASC' ); | |
return $wp_query; | |
} | |
} |
This file contains 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
$('#contactform').parsley({ | |
//exclude input type , file ? | |
excluded: 'input[type=hidden]', | |
validators: { | |
// for #3 ,checking the input must have value , example dropdown list with "Select this" kind of option should be no value so that it can be skipped | |
checkdefault: function (val, checkdefault) { | |
if (val[0] === '') return false; | |
else return true; | |
} | |
}, |
This file contains 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
$config['modules']['operation_queue'] = array( | |
'module_name' => 'Queue Management', | |
'module_uri' => 'operation/queue', | |
'model_name' => 'queue_model', | |
'model_location' => 'operation', | |
'permission' => 'operation/queue', | |
'nav_selected' => 'operation/queue', | |
'default_col' => 'date_added', | |
'display_field' => 'id', | |
'filters' => array('date_added' => array('default' => date('Y-m-d',time()), 'label' => 'Queue Day', 'type' => 'select')), |