WordPress Custom Post Status not Public but Viewable Through Link: Privately Published Posts

I have been working on my site to bring up private posts on my site. I built a custom post status for this purpose.

My goal is to exclude posts belonging to that post status from search, from Blog Page, from WordPress Queries, RSS Feed etc. Basically there should be no mentions of it anywhere on site.

Till here it seems simple, but the problem is that I WANT people to be able to view the post via direct link.

Basically I want it to be not mentioned throughout my site, but if someone visits it from direct link, they can view it.

function custom_post_status(){  register_post_status( 'privatised', array( 'label' => _x( 'Privately Published', array('post', 'download')), 'public' => false,  'exclude_from_search' => true, 'show_in_admin_all_list' => true,  'show_in_admin_status_list' => true,  'label_count' => _n_noop( 'Privately Published <span class="count">(%s)</span>', 'Aggregated <span class="count">(%s)</span>' ),  ) );  }  add_action( 'init', 'custom_post_status' );  

Here if you see in the Array, the first option is Public, and I set it to false, which basically ensures that my post is not there on my Blog Page, or search, or Taxonomy Page, or RSS FEED etc. Etc. But if I open the same post via it’s direct url, then it gives a 404, because not found…

Please help, me have my post visible only through the direct link of it.

As a sidenote, Is it possible that I can have it public, and then exclude it from Taxonomy and all, like I can do with exclude from search…

How do I control the output of a custom post type in the loop?

I’m working on a new content type. Let’s call it hotel rooms (it is not but the similarities are good enough).

Now, for each room, I will have a title and a description but I will also have a lot of metadata – beds, sea view, room number, size, summer price, winter price, and so on.

I would like my custom type to work on any theme. That means I need to provide a way to layout the post for index.php, single.php, and so forth. Obviously, presenting metadata is a large part of this.

How do I do this?

Embed Iframe inside a Facebook post to allow users in emergency situations to report us

My company has the need to collect emergency data from our Facebook page fans.
We are doing an experiment to allow some users who are located very far from emergency services to report their cases on our Facebook page (very long story).

So we want to place an iframe with a form that was optimized for a very long time.

I saw an app that is doing that: https://quiz-app.co/

But I don’t have a clue how they did that.

Thanks

disable (read only) a field if within a custom post type name

I have two bidirectional fields ‘album_band’ in two different custom post types ‘album’ and ‘band’.

this field allow multiple selection and is mandatory in ‘album’

I’ve been trying to disable or set it as ‘read only’ this field in one custom type ‘band’ (backend side) to avoid empty value in ‘album’ but without success

many thanks for your help

Unknown hash from plaintext HTTP POST request

I was intercepting some HTTP POST requests while doing some pentests for the company i work for and i found this POST request:

{"username-enc":"a5389f74e655a7f6c0526a84eb2137e0d310d5418db630fa","password-enc":"a5f2151cc46354c6f83b437d330cfb4af99744f97ba39914"} 

I ran this through several hashing sites to see if it was a simple MD5 or SHA1 but no luck.

Some backstory…this was from some authentication via an inductive automation app.

Hydra HTTP Form Post with parameters containing a colon “:”

I’m trying to brute force login on my domain using THC Hydra v9.1-dev. It is using an ASP.net form and some of the required post body parameters contain a colon : in them which is the separator used by Hydra. An example parameter: _ctl0:PlaceHolder:LoginName:txtLoginUsername=^USER^.

This makes hydra think that I have _ctl0 as the first part and Placeholder as the error message.

I tried:

  • URL encoding them, e.g this becomes: _ctl0%3APlaceHolder%3ALoginName%3AtxtLoginUsername=^USER^
  • replacing : with a \:
  • placing the parameter in quotation marks ""

but none of them worked and I can’t seem to find a way to change the separator.

Any help is much appreciated!

WordPress hook after post content and meta update

I want to update one of my meta field and redirect and I am using post_updatedhook. Here is my code.

function job_publish_status( $  post_ID, $  post_after, $  post_before ) {    $  job_published_date = get_the_time("Y-m-d", $  post_ID);    $  expire_date = date('Y-m-d', strtotime($  job_published_date. ' + 60 days'));    update_post_meta($  post_ID, '_job_expires', $  expire_date);    $  url = get_site_url();    $  url = $  url.'/wp-admin/post.php?post='.$  post_ID.'&action=edit';    wp_redirect( $  url );    exit;  } add_action('post_updated', 'job_publish_status', 99, 3 ); 

It is updating this _job_expires meta field and redirecting correctly. When I edit post content and title, its updates title and content but it is not updating other meta fields in this post. Is there any hook which triggers after post content update and meta fields update ?

How can get the last post date of the user?

I want to get the last post date was written by the user and here’s the code that I have made but it’s not working:

function get_user_last_post_date( $  user_id ) {      $  args = array(         'post_author' => $  user_id,         'post_type' => 'any',         'post_status' => 'publish',         'posts_per_page' => 1,         'order' => 'DESC',         'orderby ' => 'post_date'     );     $  latest_posts = new WP_Query( $  args );      $  last_date = '';     if ( $  latest_posts->have_posts() ) {         $  last_date = $  latest_posts;     }      return $  last_date; }