GithubHelp home page GithubHelp logo

kaz-yamam0t0 / wp-post-sitemap Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9 KB

`WP Post Sitemap` allows you to embed a shortcode [wp-post-sitemap] to create a sitemap on your WordPress websites.

License: MIT License

PHP 100.00%

wp-post-sitemap's Introduction

WP Post Sitemap

Overview

WP Post Sitemap allows you to embed a shortcode [wp-post-sitemap] to create a sitemap on your WordPress websites.

[wp-post-sitemap]

Download

With git command

cd /path/to/your-wordpress/wp-content/plugin/
git clone https://github.com/kaz-yamam0t0/wp-post-sitemap

Without git command

cd /path/to/your-wordpress/wp-content/plugin/

curl -O https://github.com/kaz-yamam0t0/wp-post-sitemap/archive/refs/heads/main.zip
tar -xzvf main.zip
rm -f main.zip

Options

Name Description Possible Values Default
type Types of posts or taxonomies category, post_tag, post, page category, page
*_head Head of the list of each types (string) (empty)
*_note Notes or descriptions placed behind each title excerpt, category, post_tag, (other taxonomies) (empty)
*_comment Whether the comment count is displayed true, false false
exlcude Excluded Post ID (for posts, pages, or other post types) (empty) (empty)
exclude_* Excluded Taxonomy ID (for all taxonomies) (empty) (empty)
orderby_* "orderby" parameters for each types. See more information on WP_Query or get_terms date, name, title, etc... date (post) or "menu_order date" (page) or name (category, post_tag, taxonomies)
order_* "order" parameters for each types. See more information on WP_Query or get_terms ASC|DESC DESC (post, page) or ASC (category, post_tag, taxonomies)

Filters

Filter Name Args Description
wpsm_list_name_htmlspecialchars (bool)$flag, (WP_Post|WP_Term)$target_obj Whether each name is escaped
wpsm_list_name (string)$name, (WP_Post|WP_Term)$target_obj for each name
wpsm_list_name_{taxonomy} (string)$name, (WP_Term)$target_obj for each name of {taxonomy}
wpsm_list_name_{post_type} (string)$name, (WP_Post)$target_obj for each name of {post_type}
wpsm_list_{post_type}_note (string)$note, (WP_Post|WP_Term)$target_obj for each note of {post_type}
wpsm_list_{post_type}_comment (bool)$comment, (WP_Post|WP_Term)$target_obj for each comment-display flag of {post_type}
wpsm_exclude (array?)$exclude, (array)$wp_query_args excluded post IDs
wpsm_exclude_{taxonomy} (array?)$exclude, (array)$get_terms_args excluded taxonomy IDs

Example of filters

add_filter("wpsm_list_name_htmlspecialchars", function($flag, $target_obj=null) {
	// if the link is for terms, the link won't be escaped.
	return !($target_obj instanceof WP_Term);
}, 10, 2);

add_filter("wpsm_list_name", function($name, $target_obj=null) {
	if ($target_obj instanceof WP_Term) {
		return sprintf('<b>[%s]</b> %s', 
						htmlspecialchars($target_obj->taxonomy, ENT_QUOTES),
						htmlspecialchars($name, ENT_QUOTES));
	} else {
		return '[post]'.$name;
	}
}, 10, 2);

wp-post-sitemap's People

Contributors

kaz-yamam0t0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.