For the button behavior,
If it’s a one-off use case, you could add custom php conditional to check the referring url $_SERVER[‘HTTP_REFERER’] and current page/post ID or url. Then, either add a class to the button’s containing div wrapper in the template for hiding via css or directly output/include the button html in the template file itself.
If it applies for various cases, I’d recommend creating an array of 2-d arrays (referrer url or post id, target url or post id). Then use (setting/checking) a session cookie to loop through the array to see if any conditions are satisfied and in turn, show or hide button
Related Posts:
- How do I programatically empty trash?
- Primary and Secondary Button Classes
- Show current navigation path from menu
- How to insert a Button or custom text on twentyseventeen header
- Override admin submit_button() functionality
- Remove “Save draft” button without using CSS
- Download a file and scroll to bottom div on button click
- Remove Save Draft & Preview Buttions.. and also Statius: Draft & Visibility: Public
- Add multiple custom buttons with custom links after add to cart button for every product
- Loading elements with a button
- How to align Button on the right of the image on desktop but below the image on mobile
- How can I center the “Buttons” in the WordPresse editor?
- Add button to menu item at the same row
- NavBar Button Clicks (need 2 clicks rather than 1 click)
- Using button from the function submit_button() triggers alert
- Create Button Using Provided Code
- How to add a breadcrumb to WordPress header?
- Page/Post path in Search Results
- Button to execute shorcode [closed]
- PayPal buttons not working after 4.2.4 upgrade
- Button not working?
- submit button not work
- I’m making a WordPress CF7 Submit Button Text Changer
- why add to cart button suddenly dissapeard
- How to get the path to the current theme?
- What’s the difference between get_home_path() and ABSPATH?
- theme path in javascript file
- When moving a WP site, why does wp-admin redirect to old site?
- How to add “Insert/Edit link” button in custom popup tinymce window?
- How to add a page to the Yoast breadcrumbs
- Symbolic Links on dev box with plugins and stylesheets
- Add popup window to TinyMCE buttons
- Add button to TinyMCE bar without creating a plugin
- Making breadcrumb with wp_nav_menu
- How to add multiple buttons to TinyMCE?
- Setting a custom sub-path for blog without using pages?
- Using WordPress to make a “Product Search” type navigation drilldown
- How can you change the ‘Insert into Post’ title in the media button?
- Change the path where wordpress plugins are uploaded
- How i can i add a split button or list box to the WordPress TinyMCE instance
- How to display a raw HTML page (bypassing WordPress theme, scripts, etc)
- Add Button To Top Toolbar in Gutenberg
- How to add a button to custom post type’s posts-page
- TinyMCE Anchor Button not showing
- How do I ‘rebuild’ the WordPress Media library after transfer to new host?
- Remove border radius setting from the Gutenberg button block?
- Which method is best to enqueue scripts
- How to get WordPress to save upload file beyond web root [closed]
- Adding submit or update button to custom metabox?
- How to call plugin path in JS?
- Absolute Path (ABSPATH) in WordPress is not working
- Display posts for a single post format
- Breadcrumbs showing Parent and Child Pages
- Hook filter to change wp_upload_dir() path in multisite
- Editing Screen: Make Update or Publish Button Follow The Page
- Hook and send Woocommerce data after click Place Order button
- How to inject custom url path for page ?
- Custom “Publish” / “Update” button &
- Slugs as breadcrumbs for Pages
- Custom Shortcode and Button not Working after 3.9 update
- How to display parent category name and link for custom breadcrumb
- Change posts list Breadcrumb
- Breadcrumbs with custom post type without plugin
- Adding TinyMCE custom buttons when using teeny_mce_before_init
- If on term-page -> get the current term?
- Breadcrumb how i can display page title with parent > child title with permalink ? any Idea
- How to Make admin Sidebar Menu always be Collapse by code
- how to grab first link in post… and of course call it
- Quicktags on all textarea.. Not working on plugin?
- WordPress login page logo customization
- Migrating a File from Plugin to Theme and changing its path → instead create a REST endpoint
- Custom Taxonomy Breadcrumb Navigation
- Retrieve Path of admin.php
- recommended breadcrumb plugins with possibility for hiding “Home” link [closed]
- Why doesn’t WP_PLUGIN_DIR definition use DIRECTORY_SEPARATOR?
- issues including a file from a plugin directory
- ABSPATH not working! Any idea why?
- Yoast SEO breadcrumbs: how to create a filter that uses the url slug for breadcrumb titles
- Plugin base URL
- how to automatically generate hierarchical menus from hierarchy of pages?
- What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
- Wrong path for theme assets
- Programmatically add a custom page/path/url/route to WordPress
- Get uploaded image url
- How can I get a link path to use for my resources such as JS scripts?
- Get the posttype of a taxonomy/term
- Remove ‘wp-content/themes/themename/’ from Image path
- WYSIWYG – Getting the “link” button from HTML mode in Visual mode
- How to remove buttons from gutenberg toolbar
- Header Button Chance Polylang Elementor
- Alias ‘wp-content’ directory to something shorter (framework?)
- How to add category to the permalink and breadcrumb?
- Display “add to cart” button on every listing in product category page?
- Change path of the page’s template
- How-to get the get_category_parents() breadcrumbs trail without link on last item
- How to create a link to jump to “Leave a comment” part?
- Problem with loading images from child theme CSS file with relevant path
- Adding another “Add Post” button to admin
- How to align a single Gutenberg block button in WP 5.5.3?
- Components used in Themes and Plugins: How to get file URL?