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
/** | |
* Retrive Channel IDs | |
* | |
* This function retreives all categories which are set as channels. | |
* Channels on the website are special categories that have a mailing | |
* list attached which users can subscribe to. | |
* | |
* It returns an array of term objects if $format is set to 'objects', | |
* otherwise returns an array of term_ids. | |
* |
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
/* | |
Plugin Name: Auto Add Read Posts | |
Description: A plugin that adds read posts to the user's read list - requires the Unread Posts plugin | |
Version: 1.0.0 | |
Author: Daniel Pataki | |
Author URI: http://danielpataki.com/ | |
License: GPLv2 or later | |
*/ | |
add_action( 'wp', 'auto_add_post_to_read_list' ); |
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
public function widget( $args, $instance ) { | |
echo $args['before_widget']; | |
if( !empty( $instance['title'] ) ) { | |
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $args['after_title']; | |
} | |
// Main Widget Code Here |
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
$delete_link = wp_get_shortlink( get_the_ID() ) . '&delete=true'; | |
$nonced_link = wp_nonce_url( $delete_link, 'delete-post-' . get_the_ID(), '_mynonce' ); |
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
<strong>bold text</bold> |
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 $greeting = __( 'Hello There!', 'text-domain' ); ?> |
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
== Changelog == | |
= 1.1.4 = | |
* WordPress 4.2 compatibility check | |
= 1.1.3 = | |
* Added hook for modifying the post types | |
* Added Hungarian translation |
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
function welcome_screen_assets( $hook ) { | |
if( 'dashboard_page_welcome-screen-about' == $hook ) { | |
wp_enqueue_style( 'welcome_screen_css', plugin_dir_url( __FILE__ ) . '/style.css' ); | |
} | |
} | |
add_action( 'admin_enqueue_scripts', 'welcome_screen_assets' ); |
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
register_activation_hook( __FILE__, 'my_initial_setup' ); | |
function my_initial_setup() { | |
$admin = get_role( 'administrator' ); | |
$overlord_caps = $admin->capabilities; | |
$overlord_caps[] = 'be_overlord'; | |
$role = add_role( 'overlord', 'Overlord', $overlord_caps ); | |
} |
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
$args = array( | |
'post_type' => 'attachment', | |
'post_status' => 'any', | |
'posts_per_page' => -1 | |
); | |
$attachments = new WP_Query( $args ); | |
while ( $attachments->have_posts() ) { | |
$attachments->the_post(); | |