2017 © Pedro PelĂĄez
 

library theme-lib-404

404 status helper functions for WordPress themes

image

mindkomm/theme-lib-404

404 status helper functions for WordPress themes

  • Tuesday, February 13, 2018
  • by gchtr
  • Repository
  • 3 Watchers
  • 0 Stars
  • 80 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 54 % Grown

The README.md

404

404 status helper function for WordPress themes., (*1)

Installation

You can install the package via Composer:, (*2)

composer require mindkomm/theme-lib-404

Functions

Name Summary Type Returns/Description
force_404 Forces 404 headers on a query.

force_404

Forces 404 headers on a query., (*3)

Use this function in a WordPress template file., (*4)

When a template other than 404.php is loaded, the proper headers for a 404 status are not set properly. This function can be used to set proper headers even after a template file is loaded., (*5)

What you have to do after this request is to include the 404 template and exit after it., (*6)

PHP, (*7)

if ( 'publish' !== $post->post_status ) {
    force_404();
    Timber::render( '404.twig', $context );
    exit;
}

Support

This is a library that we use at MIND to develop WordPress themes. You’re free to use it, but currently, we don’t provide any support., (*8)

The Versions

13/02 2018

dev-master

9999999-dev

404 status helper functions for WordPress themes

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

13/02 2018

1.0.0

1.0.0.0

404 status helper functions for WordPress themes

  Sources   Download

MIT

The Requires

  • php >=7.0.0