private function InstapageCmsPluginWPConnector::isProhibitedPageSlug in Instapage plugin 7.3
Same name and namespace in other branches
- 8.3 core/connectors/InstapageCmsPluginWPConnector.php \InstapageCmsPluginWPConnector::isProhibitedPageSlug()
Checks if given slug is prohibited in terms of publishing a landing page. If it's free - will return false. Otherwise an array with slug details will be returned
@uses self::getSiteURL() @uses self::getDBPrefix() @uses self::getResults()
Parameters
string $slug Slug to be checked:
Return value
bool|array
1 call to InstapageCmsPluginWPConnector::isProhibitedPageSlug()
- InstapageCmsPluginWPConnector::isProhibitedSlug in core/
connectors/ InstapageCmsPluginWPConnector.php - Checks if given slug is prohibited in terms of publishing a landing page. If it's free - will return false. Otherwise an array with slug details will be returned
File
- core/
connectors/ InstapageCmsPluginWPConnector.php, line 1065
Class
- InstapageCmsPluginWPConnector
- Class that utilizes native WordPress functions to perform actions like remote requests and DB operations.
Code
private function isProhibitedPageSlug($slug) {
$editUrl = $this
->getSiteURL() . '/wp-admin/post.php?action=edit&post=';
$dbPrefix = $this
->getDBPrefix();
$sql = 'SELECT ID AS id, post_name AS slug, CONCAT(\'' . $editUrl . '\', ID) AS editUrl FROM ' . $dbPrefix . 'posts WHERE post_type = \'page\' AND post_name = \'%s\' LIMIT 1';
$results = $this
->getResults($sql, $slug);
return $results;
}