Skip to content

WP Developing

Learning WP Development My Way

Tag: page-5

Is Google Maps Street View supported?

Me: This was to be added to a previous version, I have not personally checked to verify that it is so.

Is it possible to have a modal box with the detail page for a listing appear when someone clicks on the link for an individual listing page from a category page?

This is not currently possible, it is planned for a future version.

Is it possible to create a permalink like domainname.com/location/category?

This is not currently possible.

On mobile, I cannot see the Google Map, why?

The Google Map is hidden if it cannot fit within the viewport of the device.

Is it possible to limit the number of frontend submissions to one per user?

There is no built-in functionality at this point, but it should be possible using a custom filter function on the user_has_cap hook. The following code (add to your theme’s functions.php file) will count the number of published posts of a certain type by a specific user and remove the permission to add new posts for the specific post type if the user has already published a post.

Note: You need to change the ‘directory_dir_ltg’ part to the post type of your directory listing. The post type name is viewable from:

Directories –> [Your Directory] –> Content Types.

add_filter('user_has_cap', function($allcaps, $cap, $args) {
// Some initializations
$post_type = 'directory_dir_ltg';
$cap_to_check = 'drts_entity_create_' . $post_type;
$limit = 1;
// Bail out if this is not the capability we are looking for
if ($cap[0] !== $cap_to_check) {
    return $allcaps;
}
// Bail out if the current user doesn't have the capability currently
if (!isset($allcaps[$cap_to_check])) {
    return $allcaps;
}
// Bail out if the number of posts by the current user is below the limit
if (count_user_posts($args[1], $post_type) < $limit) {
    return $allcaps;
}
// Remove the capability
unset($allcaps[$cap_to_check]);
return $allcaps;
}, 10, 3);

Can one purchase an extended license to the plugin so that one can include it in one’s themes?

Not currently.

Recent Posts

  • Things You Almost Certainly Will Never Need to Know: WDS-Shortcodes
  • DevKinsta: Initial Thoughts and Feedback
  • Migrating a WordPress Site to SpinupWP the Easy Way
  • When You Get an Invalid Default Value Error While Changing Your MySQL Engine on a Table from MyISAM to InnoDB
  • Headless WordPress

Recent Comments

  • phg3a on Things I’ve Learned Using Flywheel Local
  • Ben on Things I’ve Learned Using Flywheel Local

Archives

  • May 2021
  • April 2021
  • November 2020
  • September 2020
  • May 2020
  • April 2020
  • September 2018

Categories

  • Database
  • Developer Knowledge
  • Developer Tooling
  • Directories Pro
  • Gatsby
  • Hosting
  • MySQL
  • Plugins
  • SQL
WP Developing Proudly powered by WordPress