Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

permalink of pending posts not working

// Make Non Login user see pending posts
function allow_pending_listings($qry)
{
	if (isset($_GET['p'])) {

		$post = get_post($_GET['p']); // parameter "p" in url
		if (!is_admin()) {
			$qry->set('post_status', array('publish', 'pending'));
			// will add the "pending" status to loop query
		}
	}
}
add_action('pre_get_posts', 'allow_pending_listings');
Comment

PREVIOUS NEXT
Code Example
Typescript :: Exclude code from hints delphi 7 
Typescript :: adonis route group 
Typescript :: postgresql geojson points distance and typeorm 
Typescript :: output products from collection 
Typescript :: typescript abstract static method 
Typescript :: take two inputs from user and add them using callback function 
Typescript :: How to pass multiple route parameters in Ionic-Angular? 
Typescript :: find unique elements in pandas and their connection with other column 
Typescript :: which view should a user query to display the columns associated with the constraints on a table owned by a user? 
Typescript :: TypeError: __cinit__() takes at least 2 positional arguments (0 given) 
Typescript :: testing without requirements 
Typescript :: firewalld list ports redbat 8 
Typescript :: see all github issue comments i made site:stackoverflow.com 
Typescript :: angular child routes not working 
Typescript :: material ui tab link external 
Typescript :: cant find the name console 
Typescript :: what to do when testing new feature with limited information 
Typescript :: paste elements of a vector r 
Typescript :: django query to return User whose first name starts with j or last name starts with h 
Typescript :: program that will convert input number to farenheit to its equivalent measure in celsius for python 
Typescript :: consisting either of digits only or Latin letters 
Typescript :: how to get the elements of a pair scheme 
Typescript :: read_contacts android 
Typescript :: wifi disconnects frequently when downloading 
Typescript :: add optional parameters javascript or typescript function 
Typescript :: singleton design pattern typescript 
Typescript :: stratford school academy 
Typescript :: Helpppppp!!!........... 
Typescript :: how to make game objects spread in a specific vector 
Typescript :: multer s3 file upload 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =