"Press This" button how to configure it ?

  • Unknown's avatar

    Dear All,

    My issue is about the press this function. I am using the old “press this” function the one in the wp-admin/index.php, because when you use this one, you get all the media used in the webpage, the title is filled, but you don’t have the format table to change for example the H1 or H2 paragraph https://servimg.com/view/19484304/29. With the new press this the one located in the writing tab, it just give you the source of the page https://servimg.com/view/19484304/28. So how to change the code to have more option ? Or clues to get what I would like? Like merging the both options.

    This is my code for the first press this button javascript:(function(a,b,c,d){function e(a,c){if("undefined"!=typeof c){var d=b.createElement("input");d.name=a,d.value=c,d.type="hidden",p.appendChild(d)}}var f,g,h,i,j,k,l,m,n,o=a.encodeURIComponent,p=b.createElement("form"),q=b.getElementsByTagName("head")[0],r="_press_this_app",s=!0;if(d){if(!c.match(/^https?:/))return void(top.location.href=d);if(d+="&u="+o(c),c.match(/^https:/)&&d.match(/^http:/)&&(s=!1),a.getSelection?h=a.getSelection()+"":b.getSelection?h=b.getSelection()+"":b.selection&&(h=b.selection.createRange().text||""),d+="&buster="+(new Date).getTime(),s||(b.title&&(d+="&t="+o(b.title.substr(0,256))),h&&(d+="&s="+o(h.substr(0,512)))),f=a.outerWidth||b.documentElement.clientWidth||600,g=a.outerHeight||b.documentElement.clientHeight||700,f=f<800||f>5e3?600:.7*f,g=g<800||g>3e3?700:.9*g,!s)return void a.open(d,r,"location,resizable,scrollbars,width="+f+",height="+g);i=q.getElementsByTagName("meta")||[];for(var t=0;t<i.length&&!(t>200);t++){var u=i[t],v=u.getAttribute("name"),w=u.getAttribute("property"),x=u.getAttribute("content");x&&(v?e("_meta["+v+"]",x):w&&e("_meta["+w+"]",x))}j=q.getElementsByTagName("link")||[];for(var y=0;y<j.length&&!(y>=50);y++){var z=j[y],A=z.getAttribute("rel");"canonical"!==A&&"icon"!==A&&"shortlink"!==A||e("_links["+A+"]",z.getAttribute("href"))}b.body.getElementsByClassName&&(k=b.body.getElementsByClassName("hfeed")[0]),k=b.getElementById("content")||k||b.body,l=k.getElementsByTagName("img")||[];for(var B=0;B<l.length&&!(B>=100);B++)n=l[B],n.src.indexOf("avatar")>-1||n.className.indexOf("avatar")>-1||n.width&&n.width<256||n.height&&n.height<128||e("_images[]",n.src);m=b.body.getElementsByTagName("iframe")||[];for(var C=0;C<m.length&&!(C>=50);C++)e("_embeds[]",m[C].src);b.title&&e("t",b.title),h&&e("s",h),p.setAttribute("method","POST"),p.setAttribute("action",d),p.setAttribute("target",r),p.setAttribute("style","display: none;"),a.open("about:blank",r,"location,resizable,scrollbars,width="+f+",height="+g),b.body.appendChild(p),p.submit()}})(window,document,top.location.href,"https://eldorhaan.wordpress.com/wp-admin/press-this.php?v=8");

    The blog I need help with is: (visible only to logged in users)

  • Hi there,

    The bookmarklet via wp-admin no longer functions — where you would click on a bookmark in your browser and it would grab stuff off of a site.

    However, the editor itself when hitting wp-admin/press-this.php itself will keep working. You can still add a URL to your site similarly to how you did it with the old bookmarklet. To do this, add /wp-admin/press-this.php to the end of your site’s address. For example, to access the Press This feature on your (X) site, go to this address:

    https://yoursite.blog/wp-admin/press-this.php

    Paste the URL of the site you wish to press in the box at the top that says “Enter a URL to scan”. It will then pull in the contents as your old Press This button did before.

    Also, the new dashboard has a Press This feature you can use. It’s not as robust (you can’t copy text and have it included in the new post) — but it’s workable. You can find it at Settings > Writing.

    Hope this helps. Thanks!

  • Unknown's avatar

    Thank you very much for your reply. So this is my issue, with the first technique you tell me
    https://yoursite.blog/wp-admin/press-this.php you don’t have the option for formating like (h1 h2 etc) the option to postpone posting etc. But with the new dashbord, there is not the option to capture the content.

    So here my question, how to like “merge” the two possibilities ? Or how to configure the code inside the pressthis button ?

  • Hi –

    I’m following up for Darnell here.

    It sounds like you’re trying to work from both the wp-admin dashboard and the new one, right?

    If you save posts in draft mode you can work on them between the 2 dashboards.

  • The topic ‘"Press This" button how to configure it ?’ is closed to new replies.