By Mist on Tuesday, 13 May 2014
Posted in General Issues
Likes 0
Views 593
Votes 0
Hi guys. I need your help with a small line of code.

What i am trying to achieve is a "conditional" output for dashboard.write.php form.

If a published blog post is edited or if a draft blog post is edited -> do this - > else -> do that.


Basically i want to output something in submission form if the form is opened for a new blog post if the form is "opened" for editing an existing blog post or an existing draft, do something different.

What i achieved so far is this

<?php if ($isEdit) { ?>
do this for editing
<?php } else { ?>
do this for new post
<?php } ?>


This works great if the blog post edited is published but does not work if the blog post edited is a draft.
Any tips how to fine-tune the above code to make it work also for editing a draft ?

Thanks !
Try this,


<?php if ($blog->id) { ?>
do something here
<?php } ?>
·
Tuesday, 13 May 2014 21:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for the tip Mark.

It worked with


<?php if ($blog->id || $draft->id) { ?>
do something here
<?php } else { ?>
do something else here
<?php } ?>
·
Tuesday, 13 May 2014 21:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for updating Mist
·
Wednesday, 14 May 2014 03:47
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post