Skip to content

Instantly share code, notes, and snippets.

@osalcedo
osalcedo / Change Number of Default Post Revisions - WP-CONFIG.PHP
Last active August 29, 2015 14:21
Change Number of Default Post Revisions - WP-CONFIG.PHP
/** Change Number of Default Post Revisions **/
define( 'WP_POST_REVISIONS', 3 );
@osalcedo
osalcedo / Disable Theme and Plugin Editor - WP-CONFIG.PHP
Last active August 29, 2015 14:21
Disable Theme and Plugin Editor - WP-CONFIG.PHP
/** Disable Theme and Plugin Editor **/
define( 'DISALLOW_FILE_EDIT', true );
@osalcedo
osalcedo / Custom Login Screen - FUNCTIONS.PHP
Created May 20, 2015 17:11
Custom Login Screen - FUNCTIONS.PHP
/** Login Screen **/
function eline_login_logo() { ?>
<style type="text/css">
.login h1 a {
background-image: url(http://www.elinestudio.com/wp-content/uploads/2015/05/eline-logo-login.png);
padding-bottom: 0px;
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'eline_login_logo' );
@osalcedo
osalcedo / Dashboard Support Widget - FUNCTIONS.PHP
Created May 20, 2015 17:13
Dashboard Support Widget - FUNCTIONS.PHP
/** Dashboard Support Widget **/
function eline_dashboard_widget() {
echo "<p style='color:red; font-size:200%; font-weight:bold'>Have any questions or need help?</p>
<p style='color:blue; font-size:200%'>Send us an email by clicking <a style='color:blue; text-decoration:underline; font-weight:bold' title='Send an email to eLine Studio' href='mailto:orlando@elinestudio.com?Subject=Support%20Message' target='_top'>HERE</a>.</p>
<p style='color:black; font-size:200%; font-weight:bold'><strong>Thank you for choosing eLine Studio!</strong></p>";
}
function add_eline_dashboard_widget() {
wp_add_dashboard_widget('eline_dashboard_widget', 'Website Support', 'eline_dashboard_widget');
}
add_action('wp_dashboard_setup', 'add_eline_dashboard_widget');
@osalcedo
osalcedo / Change ‘Add to Cart’ Tex - WOOCOMMERCE
Last active August 29, 2015 14:23
Change ‘Add to Cart’ Text on Product Pages - WOOCOMMERCE
/** Change ‘Add to Cart’ Text on Product Pages **/
add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' ); // < 2.1
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); // 2.1 +
add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text' ); // 2.1 +
function woo_custom_cart_button_text() {
return __( 'Buy Now!', 'woocommerce' );
}