Shortcodes for PHP Files

I have a plugin called Sweet Custom Dashboard that actually allows me to add content and media to my dashboard for my users. It requires me to actually go into the plugin and modify a php file and then the changes reflect in the wordpress dashboard.

I tried inserting the Appointments + shortcode which would display my availability and for some reason when I do it, everything is distorted and all the formatting is gone... colors, clickable buttons, functionalilty, etc.

I"m not sure if it's a coding error on my end or something with the plugin itself. Here is the code I used within the custom dashboard php file.

<?php echo do_shortcode('[app_monthly_schedule worker=6]'); ?>
<?php echo do_shortcode('[app_confirmation]');?>

I also attached a printout of what the dashboard looks like after the shortcode is in... notice the distortion.

  • Nithin
    • Support Wizard

    Hi Jerone,

    Hope you are doing good today. :slight_smile:

    Sweet Custom Dashboard plugin doesn't seem to be maintained anymore, last update seems to be around 4 years ago. I tried to run the plugin in my installation, but the custom dashboard page doesn't seem to work with WP v4.6, so I wasn't able to test this plugin fully.

    I was able to notice there is a quote missing from your shortcode, the above shortcode should have been:
    <?php echo do_shortcode( '[app_monthly_schedule worker="6"]' ); ?>

    Please do give a try, and if that doesn't work, please do enable support access, so that we could give a closer look. You can grant access from WPMU DEV > Support > Support Access > Grant Access, or check this manual: http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Please advise if I'm missing out anything, and let us know once you enable access, so that we could help get this resolved. Have a nice day. :slight_smile:

    Kind Regards,
    Nitihn

  • Ash
    • WordPress Hacker

    Hello @Jerone

    This is because, some styles and scripts doesn't load in backend, it only loads in front end. The appointment shortcodes, specially calendar shortcodes need style and script to work. Usually, front end styles and scripts are different than admin level script. I believe this is the case in your scenario. You will have to edit core appointments plugin file, and enqueue the required css and js into admin as well.

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.