Function Reference: geodir_get_addlisting_link
Summary
Returns add listing page link.
Global Values
- $wpdb
- (object) (required) WordPress Database object.
- Default: None
Package
GeoDirectory
Parameters
- $post_type
- (string) (required) The post type.
- Default: None
Return Values
- (string)
- Listing page url if valid.
- Otherwise home url will be returned.
Change Log
Since: 1.0.0
Source File
geodir_get_addlisting_link() is located in geodirectory-functions/general_functions.php [Line: 174]
Source Code
function geodir_get_addlisting_link( $post_type = '' ) { global $wpdb; //$check_pkg = $wpdb->get_var("SELECT pid FROM ".GEODIR_PRICE_TABLE." WHERE post_type='".$post_type."' and status != '0'"); $check_pkg = 1; if ( post_type_exists( $post_type ) && $check_pkg ) { $add_listing_link = get_page_link( geodir_add_listing_page_id() ); return esc_url( add_query_arg( array( 'listing_type' => $post_type ), $add_listing_link ) ); } else { return get_bloginfo( 'url' ); } }