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
var docs = om_docs.docs; // Loaded via wp_localize_script() | |
/* | |
Sample docs array | |
[ | |
{ | |
title: 'A post title', | |
url: 'http://optinmonster.com/docs/a-post-title' | |
} | |
] |
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 | |
// Instead of blindly returning $collection... | |
if ( $collection instanceof \Serializable ) { | |
// We know this would be a new collection | |
return $collection; | |
} else { | |
// This is a transient from the database so | |
// we need to use the native PHP unserialize function. | |
return unserialize( $collection ); | |
} |
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 | |
/** | |
* Check value to find if it was serialized. | |
* | |
* If $data is not an string, then returned value will always be false. | |
* Serialized data is always a string. | |
* | |
* @since 2.0.5 | |
* | |
* @param string $data Value to check to see if was serialized. |
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 | |
/** ..... */ | |
public function all() { | |
if ( false === ( $collection = get_transient( '_optin_cache_' . $this->user->ID . '_all' ) ) ) { | |
$optins = get_posts( | |
array( | |
'post_type' => 'optin_saas', | |
'author' => $this->user->ID, | |
'no_found_rows' => true, | |
'cache_results' => false, |
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
grunt.registerTask('default', 'An empty task', function() { | |
grunt.log.error('This is an empty task to keep bad things from happening.'); | |
return false; | |
}); | |
grunt.registerTask('package', ['mkdir', 'compress', 'rename', 'aws_s3:myBucket']); |
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
module.exports = function (grunt) { | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ |
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
mkdir: { | |
all: { | |
options: { | |
create: ['dist'] | |
} | |
} | |
}, |
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
compress: { | |
main: { | |
options: { | |
archive: 'my-cool-plugin.zip' | |
}, | |
expand: true, | |
src: [ | |
'assets/*', | |
'includes/*', | |
'my-cool-plugin.php' |
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
aws_s3: { | |
options: { | |
accessKeyId: '1234', // Use your own access key | |
secretAccessKey: 'abcd', // Use your own secret access key | |
region: 'US1', // Fill in your S3 region | |
uploadConcurrency: 5, // 5 simultaneous uploads | |
downloadConcurrency: 5, // 5 simultaneous downloads | |
params: { | |
CacheControl: '2592000' | |
} |
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
module.exports = function (grunt) { | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ | |
mkdir: { | |
all: { | |
options: { | |
create: ['dist'] | |
} | |
} | |
}, |