Completed
Push — hotfix/fix_notices ( 9d56c9...88019d )
by Ravinder
17:04
created

deprecated-functions.php ➔ give_log_default_views()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 30 and the first side effect is on line 16.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * Deprecated Functions
4
 *
5
 * All functions that have been deprecated.
6
 *
7
 * @package     Give
8
 * @subpackage  Deprecated
9
 * @copyright   Copyright (c) 2016, WordImpress
10
 * @license     https://opensource.org/licenses/gpl-license GNU Public License
11
 * @since       1.4.1
12
 */
13
14
// Exit if accessed directly.
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
20
/**
21
 * Checks if Guest checkout is enabled for a particular donation form
22
 *
23
 * @since 1.0
24
 * @deprecated 1.4.1
25
 *
26
 * @param int $form_id
27
 *
28
 * @return bool $ret True if guest checkout is enabled, false otherwise
29
 */
30
function give_no_guest_checkout( $form_id ) {
31
32
	$backtrace = debug_backtrace();
33
34
	_give_deprecated_function( __FUNCTION__, '1.4.1', null, $backtrace );
35
36
	$ret = get_post_meta( $form_id, '_give_logged_in_only', true );
37
38
	return (bool) apply_filters( 'give_no_guest_checkout', give_is_setting_enabled( $ret ) );
39
}
40
41
42
/**
43
 * Default Log Views
44
 *
45
 * @since      1.0
46
 * @deprecated 1.8
47
 * @return array $views Log Views
48
 */
49
function give_log_default_views() {
50
51
	$backtrace = debug_backtrace();
52
53
	_give_deprecated_function( __FUNCTION__, '1.8', null, $backtrace );
54
55
	$views = array(
56
		'sales'          => esc_html__( 'Donations', 'give' ),
57
		'gateway_errors' => esc_html__( 'Payment Errors', 'give' ),
58
		'api_requests'   => esc_html__( 'API Requests', 'give' ),
59
	);
60
61
	$views = apply_filters( 'give_log_views', $views );
62
63
	return $views;
64
}