Download the PHP package samiahmedsiddiqui/custom-permalinks without Composer

On this page you can find all versions of the php package samiahmedsiddiqui/custom-permalinks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package custom-permalinks

Custom Permalinks

You want to take control of your WordPress site's URLs? The Custom Permalinks plugin gives you the power to set unique, custom URLs for any post, page, tag, or category. This means you can design your site's structure exactly how you envision it, rather than being limited by WordPress's default settings. When you set a custom permalink, the original post URL will be automatically redirected to your new, customized URL.

Key Features

Getting Started: Plugin Settings

You can configure Custom Permalinks by navigating to Settings > Custom Permalinks in your WordPress Dashboard.

Available Tags for Permalink Structures

When setting up your custom permalink structures, you can use a variety of tags that will dynamically populate the URL. Here's a breakdown of what's available:

Tag Name Description
%year% The year of the post in four digits, eg: 2025
%monthnum% Month the post was published, in two digits, eg: 01
%day% Day the post was published in two digits, eg: 02
%hour% Hour of the day, the post was published, eg: 15
%minute% Minute of the hour, the post was published, eg: 43
%second% Second of the minute, the post was published, eg: 33
%post_id% The unique ID of the post, eg: 123
%category% A clean version of the category name (its slug). Nested sub-categories will appear as nested directories in the URL.
%author% A sanitized version of the post author’s name.
%postname% A clean version of the post or page title (its slug). For example, "This Is A Great Post!" becomes this-is-a-great-post in the URL.
%parent_postname% Similar to %postname%, but uses the immediate parent page's slug if a parent is selected.
%parents_postnames% Similar to %postname%, but includes all parent page slugs if parents are selected.
%title% The title of the post, converted to a slug. For example, "This Is A Great Post!" becomes this-is-a-great-post. Unlike %postname% which is set once, %title% automatically updates in the permalink if the post title changes (unless the post is published or the permalink is manually edited).
%ctax_TAXONOMY_NAME% A clean version of a custom taxonomy's name. Replace TAXONOMY_NAME with the actual taxonomy name. You can also provide a default slug for when no category/taxonomy is selected by using ?? (e.g., %ctax_type??sales% will use "sales" as a default).
%ctax_parent_TAXONOMY_NAME% Similar to %ctax_TAXONOMY_NAME%, but includes the immediate parent category/tag slug in the URL if a parent is selected.
%ctax_parents_TAXONOMY_NAME% Similar to %ctax_TAXONOMY_NAME%, but includes all parent category/tag slugs in the URL if parents are selected.
%custom_permalinks_TAG_NAME% Developers have the flexibility to define their own custom tags(replace _TAG_NAME with your desired name). To ensure these tags resolve to the correct permalinks, simply apply the custom_permalinks_post_permalink_tag filter.

Important Note: For new posts, Custom Permalinks will keep updating the permalink while the post is in draft mode, assuming a structure is defined in the plugin settings. Once the post is published or its permalink is manually updated, the plugin will stop automatic updates for that specific post.

Advanced Customization and Filters

Custom Permalinks offers developers a robust set of filters and actions to precisely control its behavior. This section outlines how to leverage these features for tasks like generating permalinks programmatically and fine-tuning URL structures.


Setting a Custom Value in Your Post Type Permalink

Let's say you have a custom post type named "Press" and you want to include the year and month from an ACF (Advanced Custom Fields) date field directly in its permalink.

If your post type's permalink structure is about/newsroom/press-releases/%custom_permalinks_year%/%custom_permalinks_month%/%postname%/, here's how you can achieve that with a custom value:

This custom_permalinks_post_permalink_tag filter allows you to dynamically insert values into your permalink structure. The example retrieves the year and month from your ACF date field named press_date and inserts them where %custom_permalinks_year% and %custom_permalinks_month% are defined in your permalink structure. You can integrate this code into your theme's functions.php file or a custom plugin to retrieve those values and return them for the respective permalink tags.


Manipulate Permalink Before Saving

Make changes to a permalink string just before it's saved to the database. This is useful for enforcing specific formatting, like ensuring a trailing slash:


Allow Accented Letters in Permalinks

Enable the use of accented characters in permalinks:


Allow Uppercase Letters in Permalinks

Enable the use of uppercase characters in permalinks:


Allow Redundant Hyphens in Permalinks

Allow permalinks to contain redundant hyphens (e.g., --):


Generating Custom Permalinks

This section outlines how to generate custom permalinks for your WordPress posts, either individually or for an entire post type. This functionality allows site owners and developers to programmatically create or regenerate permalinks without manual updates.

Generate Permalink for a Single Post ID

To generate a custom permalink for a specific post, you can use the following action hook, replacing $post_id with the actual ID of your post:

This simple line of code triggers the permalink generation process for the specified post.

Generate Permalinks for an Entire Post Type

For bulk updates or after structural changes, you might need to regenerate permalinks for all posts within a specific post type. Here's an example demonstrating how to do this for a custom post type called product.

This PHP function iterates through all published posts of the specified $post_type and applies the do_action hook to each, ensuring their permalinks are regenerated. You can integrate this code into your theme's functions.php file or a custom plugin, typically running it as a one-time process or via an administrative trigger.


Exclude Post Type from Custom Permalink Form

Remove the custom permalink settings form from the edit screen of a specific post type:


Exclude Specific Posts from Custom Permalink Form

Remove the custom permalink settings form from individual posts based on criteria like their ID:


Exclude Permalink from Processing

Skip processing for specific permalinks, which can be useful for URLs like XML sitemaps:


Add PATH_INFO to $_SERVER Variable

Enable PATH_INFO to be added to the $_SERVER superglobal variable:


Disable All Redirects

To prevent Custom Permalinks from performing any redirects:


Disable Specific Redirects

Prevent a particular permalink from being redirected by checking its value:


Disable like Query

Disable the like query functionality, which can impact URL matching in some specific scenarios:

Note: Use cp_remove_like_query if URLs don't work after upgrading to v1.2.9.

Note: If you experience issues with URLs after upgrading to v1.2.9, consider using cp_remove_like_query instead.


For Assistance:


Need Help or Found a Bug?

If you experience any site-breaking issues after upgrading, please report them on the WordPress Forum or GitHub with detailed information. You can always revert to an older version by downloading it from https://wordpress.org/plugins/custom-permalinks/advanced/.

Installation

You have two ways to install Custom Permalinks:

From within WordPress

  1. Go to Plugins > Add New in your WordPress dashboard.
  2. Search for "Custom Permalinks".
  3. Click "Install Now" and then "Activate" the plugin from your Plugins page.

Manually via FTP

  1. Download the custom-permalinks folder.
  2. Upload the custom-permalinks folder to your /wp-content/plugins/ directory.
  3. Activate Custom Permalinks through the "Plugins" menu in your WordPress dashboard.

All versions of custom-permalinks with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package samiahmedsiddiqui/custom-permalinks contains the following files

Loading the files please wait ....