Is it possible to put the buttons inside different shortcodes?
-
Hi, thanks for the plugin, it’s great.
I was wondering if it was possible to put upload, update and other button in different shortcodes. I wanted more control over the position of the buttons.For example, this is what I tried to do. The upload button with select image is displayed correctly but does not work. When I click on load the page updates but the changes are not saved.
Is it possible to introduce that tast inside the shortcode?
//CUSTOM SHORTCODE
function short_shortcode() {//Global
global $current_user;$user = $current_user;
ob_start();
?>
<form>
<p id=”<?php echo esc_attr((‘add-new-user’ == $user) ? ‘wpua-upload-button’ : ‘wpua-upload-button-existing’); ?>”>
<input name=”wpua-file” id=”<?php echo esc_attr((‘add-new-user’ == $user) ? ‘wpua-file’ : ‘wpua-file-existing’); ?>” type=”file” /><button type=”submit” class=”button” id=”<?php echo esc_attr((‘add-new-user’ == $user) ? ‘wpua-upload’ : ‘wpua-upload-existing’); ?>” name=”submit” value=”<?php esc_html_e(‘Upload’, ‘one-user-avatar’); ?>”>
<?php esc_html_e(‘Upload’, ‘one-user-avatar’); ?>
</button>
</p>
</form>
<?php
return ob_get_clean();
}
add_shortcode(‘short’, ‘short_shortcode’);
- The topic ‘Is it possible to put the buttons inside different shortcodes?’ is closed to new replies.