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_action( 'user_new_form', 'fn_hide_notify_register_from_new_user_form' ); | |
function fn_hide_notify_register_from_new_user_form() { | |
echo '<script>jQuery(document).ready(function($) { | |
$(".user-new-php #send_user_notification").closest("tr").hide(); | |
} ); </script>'; | |
} |
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 | |
function fn_remove_dashboard_widgets() { | |
global $wp_meta_boxes; | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); |
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 `product_code`, COUNT(*) c FROM [prefix]_products GROUP BY `product_code` HAVING c > 1 | |
#Show product names | |
SELECT a.product_code,a.status,b.product | |
FROM xxx_products AS a | |
LEFT JOIN xxx_product_descriptions AS b | |
ON a.product_id= b.product_id | |
WHERE a.product_code | |
IN (SELECT product_code FROM xxx_products GROUP BY product_code HAVING COUNT(product_code) > 1) |
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
class Customize_WP_Login_Page | |
{ | |
public function run() | |
{ | |
add_action('login_enqueue_scripts', array( $this, 'login_enqueue_scripts' )); | |
add_action('login_title', array( $this, 'replace_login_title' )); | |
add_action('login_headerurl', array( $this, 'replace_login_headerurl' )); | |
add_action('login_headertitle', array( $this, 'replace_login_headertitle' )); | |
} |
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
define('AUTOSAVE_INTERVAL', 300 ); // seconds | |
define('WP_POST_REVISIONS', false ); | |
define( 'WPCF7_ADMIN_READ_CAPABILITY', 'manage_options' ); | |
define( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY', 'manage_options' ); | |
define('DISALLOW_FILE_EDIT', 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
// Add excerpt to pages | |
add_action( 'init', 'custom_add_excerpts_to_pages' ); | |
function custom_add_excerpts_to_pages() { | |
add_post_type_support( 'page', 'excerpt' ); | |
} | |
/* | |
Add Page Order column to Pages List Admin page | |
*/ | |
add_filter('manage_pages_columns', 'custom_columns'); |
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
// Put this in child theme's function.php | |
// Upload the logo to /imahes folder of child theme | |
// Logo must be 80 x 80 or apply custom CSS | |
// custom admin login logo | |
function custom_login_logo() { | |
echo '<style type="text/css"> | |
h1 a { | |
background-image: url(wp-content/themes/'.get_stylesheet().'/images/logo.png) !important; | |
width:186px!important; | |
background-size: 186px 65px!important; |
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
# ----------------------------------------------------------------- | |
# .gitignore for CS Cart theme and addon development | |
# | |
# By default all files are ignored. You'll need to whitelist | |
# any addons, folders, files you want to include in the repo. | |
# | |
# To ignore uncommitted changes in a file that is already tracked, use | |
# git update-index --assume-unchanged | |
# | |
# To stop tracking a file that is currently tracked, use |
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_filter('manage_$post_type_posts_columns', 'set_$post_type_columns'); | |
function set_$post_type_columns($columns) { | |
$columns['order'] = 'Order'; | |
return $columns; | |
} | |
add_action('manage_$post_type_posts_custom_column', 'set_$post_type_show_columns'); | |
function set_$post_type_show_columns($name) { | |
global $post; | |
switch ($name) { | |
case 'order': |
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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress @salcode | |
# ver 20150227 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
# to download this file | |
# | |
# By default all files are ignored. You'll need to whitelist | |
# any mu-plugins, plugins, or themes you want to include in the repo. |