Giter Site home page Giter Site logo

davisshaver / newspack-popups Goto Github PK

View Code? Open in Web Editor NEW

This project forked from automattic/newspack-popups

0.0 1.0 0.0 38.66 MB

AMP-compatible popup notifications.

License: GNU General Public License v2.0

JavaScript 13.95% Shell 0.83% PHP 82.81% SCSS 2.42%

newspack-popups's Introduction

newspack-popups

AMP-compatible popup notifications.

Config file

Newspack Campaigns requires a custom config file to provide database credentials and other key data to the lightweight API. The file (wp-content/newspack-popups-config.php) should automatically be created. If it is not, manually add this file using the following template:

<?php
define( 'DB_USER', 'root' );
define( 'DB_PASSWORD', 'root' );
define( 'DB_NAME', 'local' );
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8' );
define( 'DB_PREFIX', 'wp_' );
define( 'NEWSPACK_POPUPS_DEBUG', true ); // Optional, for debugging.

Segmentation features

The segmentation features rely on visit logging. This is on by default, but can be turned off by setting the DISABLE_CAMPAIGN_EVENT_LOGGING flag in the aforementioned file:

define( 'DISABLE_CAMPAIGN_EVENT_LOGGING', true );

The segmentation feature causes amp-access to be added to all pages whether or not prompts are present. To override this behavior use the newspack_popups_suppress_insert_amp_access filter. The filter receives an array of prompts for the current page. To suppress, return true, for example:

add_filter(
	'newspack_popups_suppress_insert_amp_access',
	function( $should_suppress, $campaigns ) {
		if ( empty( $campaigns ) ) {
			return true;
		}
		return $should_suppress;
	},
	10,
	2
);

newspack-popups's People

Contributors

adekbadek avatar aschweigert avatar claudiulodro avatar davisshaver avatar dependabot[bot] avatar dkoo avatar gamebits avatar jeffersonrabb avatar kariae avatar laurelfulford avatar leogermani avatar matticbot avatar miguelpeixe avatar philipjohn avatar semantic-release-bot avatar thomasguillot avatar yogeshbeniwal 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.