Solved

Wordpress: wish to open media manager into 'set featured' > 'upload files' by default

Posted on 2014-04-18
10
683 Views
Last Modified: 2014-04-20
I want the wp media manager to open into 'set featured' > 'upload files' mode each time it's opened.

Maybe a function I can add to functions.php?

Appreciate any help,

Chris

example
0
Comment
Question by:St_Aug_Beach_Bum
  • 7
  • 3
10 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40009168
So off the post edit screen? Why is clicking on the Add Featured Image link in the meta box not an option here?
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40009274
Hi Jason,

Yes, basically I need that ability (set featured image) but I am using WP Front End Editor:

https://wordpress.org/plugins/wp-front-end-editor/ 

and it doesn't have a 'set featured image' link.

hmmm... that gives me an idea though....

I've experimented a bit and I see I can add a link to my single.php file that just loads when the editor is active.

I can copy the 'set featured image' from the backend and remake it in the front end. so I end up with a link like this:

http://www.mysite.com/wp-admin/media-upload.php?post_id=20461&type=image&TB_iframe=1   //id set dynamically, of course

Now, if I use that as a link it goes to that page,,, but what I really need it to do is come up as a pop up, rather like it does in the backend.

Should be a way to do that with js, eh?
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40009294
hmmm, just testing with this;

<a href="http://www.mysite.com/wp-admin/media-upload.php?post_id=<?php the_ID();?>&type=image&TB_iframe=1"
    onclick="return !window.open(this.href, 'Featured', 'width=500,height=500')"
    target="_blank">Set featured image</a>

I get a pop-up window (not the nice screen effect like wp has, but it works as a test) and I can upload an image... but it doesn't save it as 'featured', just saves it to the gallery...

Chris
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40009341
I can figure out the pop up, maybe use a colorbox.

If you can help me figure out how to get the image uploaded that way saved as the featured image, that would be great!

Chris
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40009445
ohhh... the WP jQuery Colorbox plugin makes a nice effect to bring it up.

Still haven't figured out how to get it to come up and save as a featured image though, it just comes up as the uploader only,

Chris
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:St_Aug_Beach_Bum
ID: 40009896
hmmm, I took this off the source of the edit/new post page on the backend:

<a title="Set featured image" href="http://www.mysite.com/wp-admin/media-upload.php?post_id=20486&type=image&TB_iframe=1" id="set-post-thumbnail" class="thickbox">Set featured image</a>

and tried that, instead of just using the url.

I get this though:

demo1
Instead of the newer version that you get when you click on the link from the backend.
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 40011803
Still haven't figured out how to get it to come up and save as a featured image

Might be a two step solution.  Do the standard upload on the front end to get it attached to the post and then run a function like this:

function setmahfeature($id){

        $attachment = get_post( $id );

        if( update_post_meta( $attachment->post_parent, '_thumbnail_id', $attachment->ID ) )
            show_message( "Post #$attachment->post_parent - W00t!" );
    }

Open in new window

*

* Coded from memory, YMMV.
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40012026
Got it, thank you! I'm going to throw another odd question at you in just a bit here!
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40012029
Dude, all your questions are odd.  Fun, but odd :)
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40012053
:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now