You need to use a hook and a function in your plugin file.
For example:
function sher_posts() {
$pages = get_posts($args);
foreach($pages as $page) {
$out = get_permalink($page->ID);
}
}
add_action('wp', 'sher_posts');
Of course this example doesn’t know what $args
are or what to do with $out
.
Related Posts:
- Manually set global $post vars with an ID, in order to use template tags
- How to not allow users to create new tags, but allow to them to use existing ones
- Gutenberg disallow certain custom blocks but keep all core blocks?
- Publish author posts only with editor approval?
- Limit access to posts/pages by user roles
- Remove Google Fonts Which Are (Probably) Added By Plugins
- Customizing subject in comment notification e-mails
- Common functionality between my own plugins
- WP showing “warning: call_user_func_array()”, What to do?
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- Declare a function before plugin does on the theme functions.php file
- Editor access to plugin settings
- Saving Plugin settings to the database
- Shortcode display outside the div
- Removing user contact methods works from functions.php but not from a plugin
- Custom Widget outputs the input but doesn’t save anything inside the textarea
- Use functionality of 2 wordpress plugins
- How can i change an image’s author?
- Can wp_script_is used in pluginA check if a script is being enqueued/registered from pluginB?
- Showing Co-Authors on post page
- Where to place custom functions?
- WP Job Manager Category Drop-down; Change Placeholder Text Via Filter
- Redeclare theme’s function in a plugin
- AJAX button run function
- Change wordpress current_time function to different timezone
- How to override a plugin function wrapped in a class?
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Display post lists in 2nd paragraph
- Restrict media upload size by format
- How to display custom sidebar in wordpress 5.5.2
- creating html reusable blocks via shortcodes
- Replacing a plugin function with a custom renamed function doesn’t work
- Facebook Messager Plugin
- Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()
- Disqus deleted comments are syncing with wordpress but active comments do not
- WordPress get_avatar function not correct working
- WordPress metaboxes – textfield suggestion automatically populated
- Which file of wordpress manage plugins functionalities?
- Improving the perfomance of a plugin action
- Check if variable is set in filter
- Image change on hover
- Passing stored variables to add_filter
- JQuery prepend a function
- Basics of changing plugin output
- Are there action hooks for comments?
- How to make a dynamic css class whose name changes every visit to confuse scraper
- Activate and deactivate plugin automatically
- Send email with list of active plugins upon activation/deactivation
- Using custom fields for image alt and title
- Where Should i write the code for wordpress ajax voting?
- dynamic name of the style for wp_enqueue_style
- Set up functions to be overridden without using function_exists() by short-circuiting them?
- How do I convert my WordPress website to be domain agnostic?
- Add the_post_thumbnail_url to a shortcode in function.php
- Add action to custom Function
- Show media-uploads to all users
- Help with a function in a widget
- how can authors to define custom pages?
- Adding a Tag Parameter / Filter to My Shortcode
- Call javascript functions from each page
- Add_image_size not generating correct size
- How do I create pages within a WordPress post?
- How can i call a functions.php function, from inside my plugin class?
- How to upload large media file in chunks, without any plugin?
- WP Function does not trigger on Webhook API Call
- Why do I need to reload the page for WordPress to see the new custom field added with jQuery
- Cookie value changes back to previous value after changing
- RSS Feed on WordPress showing code (hypertext) in articles titles
- how to define a html folder to make it work with WordPress commands
- Alternative Hook to the_content for Changing Background Color
- Unpublished Pages Failing To Appear On Custom Path
- Post source link plugin – small modification
- How to add specific script to WordPress webpage that will working with user input and databases
- Hide Plugin Custom Post Type Menu Link
- How to create algorithm for ordering posts in WordPress?
- ACF Fields are not showing up on Homepage
- Add external javascript to post template
- Block plugin update possibilities (but not by hiding notifications)
- Execute function activate/deactivate plugin in specific pages
- Plugin function in child theme
- Call function with button and return response
- Soflyy WP All Import Custom File Download Issue
- Update (a function) post’s featured image as soon as $image_url changes
- Why is WP template_include overwritting all templates rather than specified page?
- Why isn’t my plugin seeing other classes?
- Wp Ecommerce Reposition Product Page Product Thumbnail Image
- It possible to implement an adhoc php web application with wordpress?
- How to Overwrite validate_plugin function
- making a glossary with wordpress
- date function not correctly returning date
- Disable plugin function
- Trying to output a “Most visited blogs” list in wordpress multisite
- Access to wordpress method inside of classes
- How to prevent page load on form submission
- Send email notification when meet the condition
- WordPress: code structure
- filter just a portion of plugin function
- Make plugin admin page visible to other roles
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- wp_enqueue_script doesn’t load JS in plugin