$module_active = jet_engine()->modules->is_module_active( 'custom-content-types' );
$type_object is an instance of \jet-engine\includes\modules\custom-content-types\inc\factory.php \
<?php | |
// Removed deprecated functions | |
// sql_regcase | |
/* Create Folder */ | |
function createfolder($dir, $perm) | |
{ | |
// prevent hidden folder creation | |
$dir = ltrim($dir, '.'); |
<?php | |
$string1 = '<link href="/css/bs4-dynamic-fields-form-2.min.css" rel="stylesheet" media="screen">'; | |
$string2 = '<script src="/cdn-cgi/apps/head/qx0HK83qWJ5I3r2xnETN-ETfo6s.js"></script>"'; | |
$regex1 = '~<link(.*?)href="([^"]+)"(.*?)>~'; | |
$regex2 = '/src=(["\'])(.*?)\1/'; | |
$result1 = preg_match($regex1, $string1, $matches1); | |
$result2 = preg_match($regex2, $string2, $matches2); |
/** | |
* Prevent update notification for plugin | |
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/ | |
* Place in theme functions.php or at bottom of wp-config.php | |
*/ | |
function disable_plugin_updates( $value ) { | |
if ( isset($value) && is_object($value) ) { | |
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) { | |
unset( $value->response['plugin-folder/plugin.php'] ); | |
} |
Here's a 'simple' way to get the YouTube subscriber number from Google's Youtube API v3:
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bootstrap all elements</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> |
<?php | |
// based on the work of Jason Coleman | |
// http://www.strangerstudios.com/blog/2006/07/paginate-your-site-like-digg/ | |
/* The pagination function simply spits out a data structure | |
that you can render any way you like. | |
See also the javascript version for node: | |
https://gist.github.com/robmint/4651cf1c6f336e663dba | |
*/ |
<?php | |
$mailer = WC()->mailer(); | |
$mails = $mailer->get_emails(); | |
if ( ! empty( $mails ) ) { | |
foreach ( $mails as $mail ) { | |
if ( $mail->id == 'wc_reminder_email' ) { | |
$mail->trigger(); | |
} | |
} |
<?php | |
// minimal version | |
define( 'SHORTINIT', true ); | |
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' ); | |
// medium version (With lots of overhead) | |
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' ); | |
// full version (including functions and 200 header) | |
define( 'SHORTINIT', true ); |