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: Remove Broken Media | |
* Plugin Author: 1naveengiri(Naveen Giri) | |
* Plugin URI: http://1naveengiri.wordpress.com | |
* Description: WordPress plugin to remove all Broken Media post | |
*/ | |
/** | |
* Class to clear old revision data. |
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: Remove Draft post | |
* Plugin URI: http://1naveengiri.wordpress.com | |
* Description: plugin to remove all draft post | |
*/ | |
/** | |
* Class to clear old revision data. | |
*/ |
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
/** | |
* This was an expamle of tinymce in repeatable field | |
* I hav't handled case for copy paste text in the editor so max limit will not be checked when you cntl+c&cntl+v | |
* but on texteditor change I have reset the content to max char limit. | |
*/ | |
jQuery( document ).on( 'tinymce-editor-init', function( event, editor ) { | |
jQuery(".games-section .repeatable-item").each(function(){ | |
var this_id = jQuery(this).attr('data-items'); | |
var this_id = 'book_game_item_description_' + this_id; |
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 | |
/** | |
* To add a page/post in WordPress menu | |
*/ | |
$menu_id = 4; //menu ID. | |
$_post_id = 5; // post/page ID. | |
// note here $menu_item_db_id is already added menu item ID, if it will be 0 new menu will be added otherwise we can edit previous menu with code. | |
$menu_response_data = wp_update_nav_menu_item( $menu_id , $menu_item_db_id=0, array( | |
'menu-item-object-id' => $_post_id, | |
'menu-item-object' => 'page', |
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 | |
/** | |
* To add a custom link as custom menu item in WordPress menu | |
*/ | |
$menu_id = 4; // WordPress menu ID. | |
wp_update_nav_menu_item($menu_id, 0, array( | |
'menu-item-title' => __('Home'), | |
'menu-item-classes' => 'home', | |
'menu-item-url' => 'http://buddydevelopers.com', | |
'menu-item-status' => 'publish' |
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 | |
/** | |
* This widget is depend on https://wordpress.org/plugins/google-analytics-post-pageviews/ | |
* | |
* Steps: | |
* 1. Create a Google developer project - http://console.developers.google.com/ | |
* | |
* 2.enable google analytics service, you can check | |
* - https://www.youtube.com/watch?v=AX9PtgKPnuM, | |
* - https://developers.google.com/ad-exchange/rtb/open-bidder/google-app-guide |
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
<?xml version="1.0"?> | |
<ruleset name="WordPress Develop"> | |
<rule ref="WordPress" /> | |
</ruleset> |
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: Clear Old Revisions | |
* Plugin URI: http://buddydevelopers.com | |
* Description: plugin to clear old revision data. | |
*/ | |
/** | |
* Class to clear old revision data. | |
*/ | |
if ( defined( 'WP_CLI' ) && WP_CLI ) { |
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('wpas_gdpr_consents', 'add_new_gdpr_consent_item', 10, 1 ); | |
/** | |
* Function to add new consent in AS settings. | |
* | |
* @param array $gdpr_consent_options GDPR consent options | |
*/ | |
function add_new_gdpr_consent_item( $gdpr_consent_options ){ | |
$consent_short_desc = wpas_get_option( 'join_mailing_list_short_note', false ); | |
$gdpr_id = wpas_get_gdpr_data( $consent_short_desc ); |