Custom posts password protect

my site is highly based on clients and we want to have very strong password protection for a certain custom type post. We have a custom type post named « something » and here is it’s declaration: $args = array ( ‘label’ => ‘Something’, ‘singular_label’ => ‘Something’, ‘public’ => false, ‘publicly_queryable’ => true, ‘show_ui’ => true, ‘capability_type’ => ‘post’, ‘hierarchical’ => false, ‘rewrite’ => array(‘slug’ => « something »), ‘query_var’ => false, ‘menu_icon’ => ‘dashicons-chart-area’, ‘supports’ => array(‘title’) ); I want to make sure anything that’s under slug « something » is password protected and if…

CSS and Scalability

http://mrmrs.io/writing/2016/03/24/scalable-css/ When I read about or listen to ideas on how to scale an app’s css – most of the talk is about how to write css. The real way to scale css, is to stop writing css. Abstract out the things you use most and move to a multi-class pattern where you compose visual patterns in your html. You might be amazed at how quickly your team starts to move. If you write CSS, this is a must read. Source: web design weekly

How To Call WP_Query From A Subdomain?

I have a PHP script running in WordPress, that uses a WP_Query to get the posts from one of my subdomains and return it as a JSON string. The script only receives the post data if I call it using the correct subdomain. For example, if I go to news.example.com/api/news.php, the JSON prints correctly, but if I go to www.example.com/api/news.php it only prints an empty array. How can I call a single script that will get data from a subdomain, even if I call it using the main domain? Or…

Force update all posts in custom post type, no content changes

I have imported data from a custom post type that has location data for a map plugin (Progress Map). I have about 500+ posts each with different location data. For some reason the location data isn’t registered unless I save each post again. I’ve been looking for a way to quickly automate this but no one seems to have a solution that doesn’t involve also changing data on each post which I don’t want to do. I thought there would be a simple snippet that you can change the post…

Web Design Weekly #228

Headlines NPM Left-Pad Chaos A little bit of hot drama this week after Azer Koçulu unpublished more than 250 of his modules from NPM causing a lot of broken builds. Lots of people chimed in on the topic but I think these are the pick of the bunch. Azer Koçulu’s own story, Rich Harris’s suggested fix and Glen Maddern’s tweet rant. (theregister.co.uk) Dirty Tricks From The Dark 
Corners Of Front-End (speakerdeck.com) ​​Get multiple job offers from top companies with 1 application​ ​​Web developers are in demand, so shouldn’t companies apply…

Web Design Weekly #227

Headlines State of the Art JavaScript in 2016 A nice refreshing look at the JavaScript ecosystem by Francois Ward. JavaScript land has been thriving and moving quickly, but there’s finally a light at the end of the tunnel. Best practices are no longer changing constantly and it is becoming increasingly clear which tools are worth learning. (medium.com) What Makes Software Good? Mike Bostock shares his thoughts about what makes good software, and how to make software better. (medium.com) Sponsor Web Design Weekly and reach 25,641 designers and developers Articles Will Change…

Remove custom post type slug but keep related category taxonomy permalink

struggling as well with custom url rewriting for custom post type taxonomies. Here is my requirement: domain/mycpt_category/postname/ It’s well documented here and in several SE threads removing the CPT basename so that the resulting permalink is: domain/postname/ And I am able to construct the permalink such as: domain/cpt-basename/cpt_category/postname (following this solution ) What I am really trying to achieve is removing the custom post type slug but keep its related taxonomy category so my link would be: domain/mycpt_category/postname/ Thanks for you much appreciated help on this. Source: https://wordpress.stackexchange.com/feeds

Mixed content and expired session issues with SSL and wp-admin

I am developing a site that has an SSL certificate. I’ve activated wp-admin being conducted over https (using define(‘FORCE_SSL_ADMIN’, true); in wp-config.php). It’s created a lot of issues using wp-admin. 1) Whilst doing things in wp-admin I’ll regularly get a message saying the session has expired. As far as I can tell, this mostly happens when jumping from one admin page (url) to another page (url). 2) In Chrome I’ll often see a little silver shield in the address bar indicating there are « unsafe scripts » the page is trying to…

Does something like is_rest() exist

I am starting a bit with the REST API. If I am not completly mislead, the init action hook is also executed when its a REST API request. Now, I want to execute some code only, when it is not a REST API request. So I was looking for a command like is_rest() in order to do something like <?php if( ! is_rest() ) echo ‘no-rest-request’; ?> But I couldn’t find something like this. Is there a is_rest() out there? Source: https://wordpress.stackexchange.com/feeds