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 // Make sure to remove this tag! | |
// Add this code to your theme's functions.php file. | |
add_filter( 'optin_monster_api_menu_cap', 'om_allow_editors_in_menu' ); | |
function om_allow_editors_in_menu( $capability ) { | |
// The default capability is 'manage_options'. We can switch this out with an editor capability. | |
return 'publish_pages'; | |
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
#! /bin/sh | |
# This script assumes a few things | |
# 1. You are running Nginx | |
# 2. WP-CLI is installed | |
# 3. Your user is part of the www-data group | |
# 4. Nginx_ensite is installed (https://github.com/perusio/nginx_ensite) | |
# 5. nginx-wp-common.conf is installed at `/etc/nginx/nginx-wp-common.conf` | |
# How to use |
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 | |
add_filter( 'optinmonster_output', 'limit_views' ); | |
function limit_views ( $optins ) { | |
// Replace this with your optin slug | |
$optin_slug = 'yf3rluqqcj-lightbox'; | |
// Replace this with the number of views | |
$view_limit = 100; |
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 | |
add_action( 'plugins_loaded', 'om_sample_plugins_loaded' ); | |
function om_sample_plugins_loaded() { | |
// Bail if the main class does not exist. | |
if ( ! class_exists( 'Optin_Monster' ) ) { | |
return; | |
} |
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 | |
/** | |
* Plugin Name: OptinMonster Sample Theme | |
* Plugin URI: http://optinmonster.com/ | |
* Description: OptinMonster is the best lead generation plugin for WordPress. | |
* Author: OptinMonster Developers | |
* Author URI: http://optinmonster.com | |
* Version: 1.0 | |
* Text Domain: optin-monster-sample-theme | |
* Domain Path: languages |
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 | |
function om_sample_add_lightbox_theme( $themes, $type ) { | |
// Let's make sure we're adding to the lightbox themes. If not, return early. | |
if ( 'lightbox' != $type ) { | |
return $themes; | |
} | |
$themes['sample'] = array( | |
'name' => __( 'Sample Theme', 'optin-monster-sample-themes' ), |
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 | |
function om_sample_lightbox_theme_api( $api, $theme, $optin_id, $type ) { | |
// Let's make sure we're adding to the lightbox themes. If not, return early. | |
if ( 'lightbox' != $type ) { | |
return $api; | |
} | |
// Also return if we're not using the Sample theme | |
if ( 'sample' != $theme ) { |
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 | |
class Optin_Monster_Lightbox_Theme_Sample extends Optin_Monster_Theme { | |
/** | |
* Path to the file. | |
* | |
* @var string | |
*/ | |
public $file = __FILE__; |
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 | |
$provider = $this->get_email_setting( 'provider', '', false ); | |
$html = '<div id="om-lightbox-sample-optin" class="om-lightbox-sample om-clearfix om-theme-sample' . ( $provider && 'custom' == $provider ? 'om-custom-html-form' : '' ) . '"'; | |
$html .= '<div id="om-lightbox-theme-optin-wrap" class="om-clearfix">'; | |
// Optin content will go here! | |
$html .= '</div>'; | |
$html .= '</div>'; |
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 | |
$html .= '<a href="#" class="om-close" title="' . esc_attr__( 'Close', 'optin-monster' ) . '">×</a>'; |
OlderNewer