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 your custom stylesheet | |
* Be sure to change 'my' to your own prefix to prevent conflicts | |
*/ | |
function my_projecthuddle_styles() { | |
wp_enqueue_style( 'my_ph_style', get_stylesheet_directory_uri() . '/path/to/your/stylesheet.css', 'project-huddle', '1.0' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_projecthuddle_styles' ); |
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($){ | |
$(document ).ready(function(){ | |
Huddle.Event.on( 'commentSavedSuccess', function( $model ){ | |
// run when comment was saved | |
// this is the model object that was saved | |
console.log($model); | |
}); | |
}); | |
})(jQuery); |
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 your custom script | |
* Be sure to change 'my' to your own prefix to prevent conflicts | |
*/ | |
function my_projecthuddle_scripts() { | |
// add a new script using wp_enqueue_script | |
wp_enqueue_script( 'my_ph_script', get_stylesheet_directory_uri() . '/path/to/your/script.js', array( | |
'jquery', | |
'backbone', |
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 | |
/* | |
* Quickly add inline css styles to a project | |
* Replace .postid-3996 with your own project id | |
*/ | |
function ph_add_inline_styles() { | |
$custom_css = " | |
.postid-3996 .ph-project-image-inner { | |
height: 100%; | |
} |
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($){ | |
function phSetCookie(cname, cvalue, exdays) { | |
var d = new Date(); | |
d.setTime(d.getTime() + (exdays*24*60*60*1000)); | |
var expires = "expires="+ d.toUTCString(); | |
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; | |
} | |
function phGetCookie(cname) { | |
var name = cname + "="; |
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 | |
function wp123_ph_change_default_project_options($options) { | |
foreach ($options as $key => $val) { | |
if ($val['project_unapproval'] === $id) { | |
$unapproval = $key; | |
} | |
} | |
$options[$unapproval]['default'] = 'off'; | |
return $options; | |
} |
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 | |
/** | |
* Change the collaborate subject for project clients | |
*/ | |
function wp395_ph_change_collaborate_subject( $subject, $email, $user, $post_id ) { | |
// if user is a project client | |
if ( user_can( $user, 'project_client' ) ) { | |
$subject = 'Your Design Project is in progress.'; | |
} |
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('wp_enqueue_scripts', function () { | |
wp_add_inline_script('project-huddle', " | |
/** | |
* Hook into Approve Button View initialize method | |
*/ | |
ph.api.hooks.addAction('ph.api.views.ApproveButton.initialize', 'custom-popup', function (view) { | |
view.messageAfterApproval(); | |
}); |
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($){ | |
$(document).ready(function() { | |
/** | |
* Hook into ImageView initialize method | |
*/ | |
wp.hooks.addAction('Huddle.CommentView.initialize', function (view) { | |
view.messageAfterFirstComment(); | |
}); |
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 plugin settings | |
add_filter( 'ph_settings_extensions', 'my_extension_plugin_settings' ); | |
// add our settings | |
function my_extension_plugin_settings($settings) { | |
// add fields | |
// divider with title | |
$settings['fields'][] = array( |
OlderNewer