Skip to content

Instantly share code, notes, and snippets.

@generatepress
generatepress / remove-customize-sections
Last active October 6, 2022 03:09
Remove sections from GeneratePress Customize area
add_action( 'customize_register', function( $wp_customize ) {
// Remove default sections
$wp_customize->remove_section('generate_colors_section');
$wp_customize->remove_section('generate_typography_section');
$wp_customize->remove_panel('generate_layout_panel');
// Remove Menu Plus section.
$wp_customize->remove_panel('generate_menu_plus');
// Remove Generate Backgrounds section
public function get_fonts( $amount = 5000 )
{
$selectDirectory = '';
$selectDirectory = plugin_dir_path( __FILE__ );
$fontFile = $selectDirectory . '/cache/google-web-fonts.txt';
//Total time the file will be cached in seconds, set to a week
$cachetime = 86400 * 7;
function generate_get_fonts( $amount = 1000 )
{
if ( get_transient('generate_get_fonts') )
return;
$selectDirectory = '';
$selectDirectory = plugin_dir_path( __FILE__ );
$fontFile = $selectDirectory . '/cache/google-web-fonts.txt';
public function render_content()
{
$fonts = ( get_transient('generate_get_fonts') ? get_transient('generate_get_fonts') : '' );
if(!empty($fonts))
{
?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<select <?php $this->link(); ?>>
.main-title,
.site-description,
.main-navigation a,
.menu-toggle,
h1,
h2,
h3{
font-family: Arial, Helvetica, sans-serif;
}
.container {
background-image: url("http://www.zahnarzt-lorenz.de/dropshadow2.png") !important;
background-position: center top !important;
background-repeat: no-repeat !important;
}
.inside-navigation {
background-image: url("http://www.zahnarzt-lorenz.de/dropshadow2.png");
background-position: center top !important;
background-repeat: no-repeat;
require_once( '../../wp-load.php' );
$args = array(
'post_type' => 'edd_license',
'showposts' => -1,
's' => $_POST['email']
);
// The Query
$the_query = new WP_Query( $args );
add_action('admin_init', 'generate_activate_customer_email');
function generate_activate_customer_email() {
if( isset( $_POST['generate_customer_email_activate'] ) ) {
if( ! check_admin_referer( 'generate_customer_email_nonce', 'generate_customer_email_nonce' ) )
return; // get out if we didn't click the Activate button
$generate_customer_email = get_option( 'generate_customer_email' );
add_action('admin_init', 'generate_activate_customer_email');
function generate_activate_customer_email() {
if( isset( $_POST['generate_customer_email_activate'] ) ) {
if( ! check_admin_referer( 'generate_customer_email_nonce', 'generate_customer_email_nonce' ) )
return; // get out if we didn't click the Activate button
$generate_customer_email = get_option( 'generate_customer_email' );
<?php
require_once( '../../wp-load.php' );
if ( $_POST['generate_action'] == 'get_email' ) :
$args = array(
'post_type' => 'edd_license',
'showposts' => -1,
's' => $_POST['email']