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 | |
/** | |
* Template Name: Discourse SSO | |
* Author: Adam Capriola | |
* Version: 1.1 | |
* Author URI: https://meta.discourse.org/users/AdamCapriola/activity | |
* Adapted From: https://github.com/ArmedGuy/discourse_sso_php | |
* Uses: https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045 | |
* | |
*/ |
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 | |
/** | |
* Sync Groups from WordPress to Discourse | |
* | |
* First creates 'groups' meta_key (which should be customized to your needs) | |
* Then it monitors for changes in the 'groups' meta_value and connects to Discourse API to sync groups | |
* | |
* WordPress References | |
* https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/meta.php?order=name#L235 | |
* http://wordpress.stackexchange.com/questions/16835/how-to-hook-update-post-meta-and-delete-post-meta |
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 | |
/** | |
* SSO "Page" | |
* | |
*/ | |
add_action( 'parse_request', 'ac_parse_request' ); | |
function ac_parse_request() { | |
// Check for SSO request |
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 user meta to signify the user has just logged in | |
* | |
*/ | |
add_action( 'wp_login', 'ac_fresh_login', 10, 2 ); | |
function ac_fresh_login( $user_login, $user ) { | |
update_user_meta( $user->ID, 'fresh_login', 1 ); |
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: Discourse WordPress Integration | |
Description: This plugin contains all of the functions that deal with integrating WordPress and Discourse. | |
Author: Adam Capriola | |
Version: 1.0 | |
Author URI: https://meta.discourse.org/users/adamcapriola/activity | |
*/ | |
// Discourse info |
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 | |
/** | |
* Filter login form labels | |
* | |
* @link https://wpartisan.me/?p=444 | |
* | |
*/ | |
add_action( 'login_head', 'ac_login_head_form_labels' ); | |
function ac_login_head_form_labels() { |
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 | |
/** | |
* Remove 's | |
* @link https://core.trac.wordpress.org/ticket/31157 | |
* @link https://core.trac.wordpress.org/ticket/31676 | |
* | |
*/ | |
add_filter( 'the_content', 'ac_remove_nbsps', 10 ); // Adjust priorities if necessary | |
add_filter( 'widget_text', 'ac_remove_nbsps', 10 ); |
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 | |
/** | |
* Lede words | |
* | |
*/ | |
add_filter( 'the_content', 'ac_the_content_lede_words' ); | |
function ac_the_content_lede_words( $content ) { | |
// Get number of lede words |
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
.lede-words { | |
font-weight: 700; | |
} |
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 | |
/** | |
* Carbon Fields: Post: Formatting | |
* | |
*/ | |
add_action( 'carbon_fields_register_fields', 'ac_crb_register_fields_post_formatting' ); | |
function ac_crb_register_fields_post_formatting() { | |
Container::make( 'post_meta', 'Formatting' ) |
OlderNewer