Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

canvas save in WP post WordPress

this is my event site
i use canvas plugin for photo frame
and USP plugin for summit post
wish can user upload the file with photo frame
when send or summit bottom click then
the frame photo can be save in WP post

Answers (4)


Cesar Contreras answers:

you want to add the photo when registering a new user?

Maybe you can solve your problem using this plugin:


Bob answers:

may be this answer from site can help you.


Arnav Joy answers:

can you please describe more about your requirement ?


Mohamed Ahmed answers:


If you want to convert canvas to image URL and save it to WordPress post, You can depend on this codes

jQuery(document).ready(function($) {
/* Variables */
var canvas = $('#canvas')[0],
ctx = canvas.getContext('2d'),
photo_frame = $('.photo_frames_loading');

/* Convert canvas data to image url */
var dataURL = canvas.toDataURL('image/png');
/* Add canvas image url to photo frame div in data-url tag */

/* Use Ajax to pass canvas image url to PHP function */
var imageURL = photo_frame.attr('data-url');

// This does the ajax request
url: ajaxurl,
data: {
'imageURL' : imageURL
success:function(data) {
// This outputs the result of the ajax request
error: function(errorThrown){


#PHP to functions.php file
function save_canvas_in_wp_post() {
global $post;
if ( isset($_REQUEST) ) {

$imageURL = $_REQUEST['imageURL'];

// Save image URL to post meta field
add_post_meta( $post->ID, 'user_photo_frame', $imageURL );


add_action( 'wp_ajax_save_canvas_in_wp_post', 'save_canvas_in_wp_post' );

// If you want to also use the function for non-logged in users remove slashes from next line
// add_action( 'wp_ajax_nopriv_save_canvas_in_wp_post', 'save_canvas_in_wp_post' );

/* Localize ajax script */
function enqueue_ajax_script() {
wp_register_script('ajax-script', esc_url(get_template_directory_uri()));
wp_localize_script( 'ajax-script', 'ajaxurl', admin_url( 'admin-ajax.php' ) );

add_action('wp_enqueue_scripts', 'enqueue_ajax_script');

If you need anything else please tell us