Skip to content

Instantly share code, notes, and snippets.

$query->set('cat', '-1,-2,-3,-4,-5');
if ( $query->is_archive ) {
if ( $query->is_home || $query->is_archive) {
/****** Math Comment Spam Protection Plugin ******/
if ( function_exists('math_comment_spam_protection') && !$user_ID ) {
$mcsp_info = math_comment_spam_protection();
?>
<input type="text" name="mcspvalue" id="mcspvalue" value="" size="22" tabindex="4" />
<label for="mcspvalue"><small>كم مجموع <?php echo $mcsp_info['operand1'] . ' + ' . $mcsp_info['operand2'] . ' ?' ?> (مطلوب) </small></label>
<input type="hidden" name="mcspinfo" value="<?php echo $mcsp_info['result']; ?>" />
<?php
@mwordpress
mwordpress / update-thumbnail.php
Created May 13, 2017 09:43
add custom field to all post based on post thumbnail
<?php
include '../../../wp-load.php';
$args = array(
'posts_per_page' => -1,
'post_type' => 'post',
'post_status' => 'publish',
'suppress_filters' => true,
);
$posts_array = get_posts( $args );
@mwordpress
mwordpress / gist:1d04f842ea6895094de780071cd16dc8
Last active November 22, 2017 23:56 — forked from rodica-andronache/gist:54f3ea95bcaf76435e55
color picker in wordpress widget
class Color_Picker_Widget_25809 extends WP_Widget {
/**
* Widget constructor.
*
* @since 1.0
*
* @access public
*/
public function __construct() {
@mwordpress
mwordpress / VimeoController.php
Created October 27, 2018 11:51
Vimeo Video Download Links -- Work with wordpress
/*
* Usage :
* $video = new VimeoController;
* $data = $video->getVideoDownloadLink('https://vimeo.com/276013718');
* print_r($data);
*
*/
class VimeoController {
/*
* Get the video information
# Start Bad Bot Prevention
<IfModule mod_setenvif.c>
# SetEnvIfNoCase User-Agent ^$ bad_bot
SetEnvIfNoCase User-Agent "^12soso.*" bad_bot
SetEnvIfNoCase User-Agent "^192.comAgent.*" bad_bot
SetEnvIfNoCase User-Agent "^1Noonbot.*" bad_bot
SetEnvIfNoCase User-Agent "^1on1searchBot.*" bad_bot
SetEnvIfNoCase User-Agent "^3D_SEARCH.*" bad_bot
SetEnvIfNoCase User-Agent "^3DE_SEARCH2.*" bad_bot
SetEnvIfNoCase User-Agent "^3GSE.*" bad_bot