This file contains hidden or 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 | |
// upload a photo to facebook by URL, will return id of uploaded photo | |
$photo_uploaded = $facebook->api( $page_id . "/photos", "POST", array( | |
'url' => 'http://healthhub.co/wp-content/uploads/2014/02/Group-Slider.jpg', // remote URL to image | |
'no_story' => true // suppress automatic image upload story, optional | |
) ); |
This file contains hidden or 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 | |
// include Facebook PHP SDK | |
include "facebook/facebook.php"; | |
// init Facebook SDK with app settings | |
$facebook = new Facebook( array( 'appId' => APP_ID, 'secret' => APP_SECRET ) ); | |
// enable file upload support | |
$facebook->setFileUploadSupport( true ); |
This file contains hidden or 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 | |
/** | |
* @package MyToolbar | |
*/ | |
/* | |
Plugin Name: MyToolbar | |
Plugin URI: http://www.webniraj.com | |
Description: This plugin creates a custom toolbar | |
Version: 1.0 |
This file contains hidden or 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 WordPress items from toolbar | |
function preload_my_toolbar() { | |
global $wp_admin_bar; | |
// remove WordPress logo | |
$wp_admin_bar->remove_node('wp-logo'); | |
// remove search button |
This file contains hidden or 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
<!-- create form with open_form() --> | |
<form action="http://testapplication.com/login" method="post" accept-charset="utf-8" id="login-form" class="login"> | |
<div style="display:none"> | |
<input type="hidden" name="csrf_test_name" value="80bfb80b356d6d31f4ce4dad0c6cf69e"> | |
</div> | |
... | |
... | |
</form> | |
<!-- Update AJAX code to post serialized data --> |
This file contains hidden or 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
<!-- add to HEAD --> | |
<script type="text/javascript"> | |
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>'; | |
</script> | |
<!-- Update AJAX code, change csrf_test_name as needed --> | |
<script type="text/javascript"> | |
$.post( ajax_url, { data: 'value', 'csrf_test_name': csrf_value }, function( response ) { | |
// response | |
}, 'json' ); |
This file contains hidden or 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
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>"> |
This file contains hidden or 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
<form action="http://testapplication.com/login" method="post" accept-charset="utf-8" id="login-form" class="login"> | |
<div style="display:none"> | |
<input type="hidden" name="csrf_test_name" value="80bfb80b356d6d31f4ce4dad0c6cf69e"> | |
</div> | |
... | |
... | |
</form> |
This file contains hidden or 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
# load helper manually | |
$this->load->helper('form'); | |
# create form | |
echo form_open( base_url( 'login' ), array( 'id' => 'login-form', 'class' => 'login' ) ); |