INT. LOCATION – DAY
CHARACTER NAME
Dialogue here…
[Action description]
Super
function my_scripts_dashboard() {
if (!is_user_logged_in()) {
return ‘
Please login to view your scripts.
‘;
}
$current_user = get_current_user_id();
$args = array(
‘post_type’ => ‘scripts’,
‘author’ => $current_user,
‘posts_per_page’ => -1
);
$query = new WP_Query($args);
if (!$query->have_posts()) {
return ‘
No scripts found.
‘;
}
ob_start();
echo ‘
My Scripts
‘;
while ($query->have_posts()) {
$query->the_post();
$id = get_the_ID();
$title = esc_html(get_the_title());
$edit_link = site_url(‘/write-script/?edit_id=’ . $id);
$delete_link = get_delete_post_link($id);
$content = wpautop(get_the_content());
?>
