echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`
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 | |
require_once dirname( __FILE__ ) . '/class.settings-api.php'; | |
/** | |
* Theme Admin panel for Tareq's Planet | |
* | |
* @author Tareq Hasan | |
*/ | |
class Tareqs_Planet_Admin { |
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: Facebook Group to WP - Post Type Changer | |
* Description: Changes the default Facebook Group post type to Post | |
* Plugin URI: https://wordpress.org/plugins/fb-group-to-wp/ | |
* Author: Tareq Hasan | |
* Author URI: https://tareq.co | |
* Version: 1.0 | |
* License: GPL2 or later | |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
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: Email Log | |
* Plugin URI: https://tareq.co | |
* Description: Log all outgoing emails to <code>wp-content/uploads/emails/DATE.log</code> file | |
* Author: Tareq Hasan | |
* Author URI: https://tareq.co | |
* Version: 1.0 | |
*/ |
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: Pretty Link Role Override | |
Description: Override pretty link admin area access role | |
Plugin URI: http://tareq.co | |
Author: Tareq Hasan | |
Author URI: http://tareq.co | |
Version: 1.0 | |
License: GPL2 | |
*/ |
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 | |
/** | |
* Register a custom taxonomy | |
* | |
* @return void | |
*/ | |
function prefix_register_genere_taxonomy() { | |
register_taxonomy( 'genere', 'post', array( | |
'label' => __( 'Genre' ), |
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 | |
/** | |
* WooCommerce price adjustment for WPUF | |
* | |
* @param int $post_id | |
* | |
* @return void | |
*/ | |
function wpufe_update_post_price( $post_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 | |
add_action( 'save_post', function( $post_id ) { | |
if ( !wp_is_post_revision( $post_id ) ) { | |
$post_type = get_post_type( $post_id ); | |
// apply on specific post type and for specific user role | |
if ( $post_type == 'product' && current_user_can( 'subscriber' ) ) { | |
wp_update_post( array( |
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 | |
if ( is_multisite() ) { | |
global $wpdb; | |
$all_sites = $wpdb->get_results( "SELECT * FROM $wpdb->blogs" ); | |
if ( $all_sites ) { | |
foreach ($all_sites as $site) { | |
$wpdb->set_blog_id( $site->blog_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 | |
/** | |
* Map display shortcode | |
* | |
* @param string $meta_key | |
* @param int $post_id | |
* @param array $args | |
*/ | |
function wpuf_shortcode_map( $location, $post_id = null, $args = array() ) { | |