Code Duplication    Length = 45-45 lines in 3 locations

components/Helpers.php 1 location

@@ 104-148 (lines=45) @@
101
     * @return array
102
     * @since 2.0.2
103
     */
104
    public function setup_updated_messages ( $messages ) {
105
        global $post, $post_ID;
106
107
        $post_type = get_post_type_object( $this->object_type );
108
109
        $labels = $post_type->labels;
110
111
        $messages[ $post_type->name ] = array(
112
            1 => sprintf( __( '%s updated. <a href="%s">%s</a>', 'pods' ), $labels->singular_name, esc_url( get_permalink( $post_ID ) ), $labels->view_item ),
113
            2 => __( 'Custom field updated.', 'pods' ),
114
            3 => __( 'Custom field deleted.', 'pods' ),
115
            4 => sprintf( __( '%s updated.', 'pods' ), $labels->singular_name ),
116
            /* translators: %s: date and time of the revision */
117
            5 => isset( $_GET[ 'revision' ] ) ? sprintf( __( '%s restored to revision from %s', 'pods' ), $labels->singular_name, wp_post_revision_title( (int) $_GET[ 'revision' ], false ) ) : false,
118
            6 => sprintf( __( '%s published. <a href="%s">%s</a>', 'pods' ), $labels->singular_name, esc_url( get_permalink( $post_ID ) ), $labels->view_item ),
119
            7 => sprintf( __( '%s saved.', 'pods' ), $labels->singular_name ),
120
            8 => sprintf( __( '%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'pods' ),
121
                $labels->singular_name,
122
                esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ),
123
                $labels->singular_name
124
            ),
125
            9 => sprintf( __( '%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>', 'pods' ),
126
                $labels->singular_name,
127
                // translators: Publish box date format, see http://php.net/date
128
                date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ),
129
                esc_url( get_permalink( $post_ID ) ),
130
                $labels->singular_name
131
            ),
132
            10 => sprintf( __( '%s draft updated. <a target="_blank" href="%s">Preview %s</a>', 'pods' ), $labels->singular_name, esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ), $labels->singular_name )
133
        );
134
135
        if ( false === (boolean) $post_type->public ) {
136
            $messages[ $post_type->name ][ 1 ] = sprintf( __( '%s updated.', 'pods' ), $labels->singular_name );
137
            $messages[ $post_type->name ][ 6 ] = sprintf( __( '%s published.', 'pods' ), $labels->singular_name );
138
            $messages[ $post_type->name ][ 8 ] = sprintf( __( '%s submitted.', 'pods' ), $labels->singular_name );
139
            $messages[ $post_type->name ][ 9 ] = sprintf( __( '%s scheduled for: <strong>%1$s</strong>.', 'pods' ),
140
                $labels->singular_name,
141
                // translators: Publish box date format, see http://php.net/date
142
                date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) )
143
            );
144
            $messages[ $post_type->name ][ 10 ] = sprintf( __( '%s draft updated.', 'pods' ), $labels->singular_name );
145
        }
146
147
        return $messages;
148
    }
149
150
    /**
151
     * Enqueue styles

components/Pages.php 1 location

@@ 198-242 (lines=45) @@
195
	 * @return array
196
	 * @since 2.0.2
197
	 */
198
	public function setup_updated_messages( $messages ) {
199
200
		global $post, $post_ID;
201
202
		$post_type = get_post_type_object( $this->object_type );
203
204
		$labels = $post_type->labels;
205
206
		$messages[ $post_type->name ] = array(
207
			1  => sprintf( __( '%1$s updated. <a href="%2$s">%3$s</a>', 'pods' ), $labels->singular_name, esc_url( get_permalink( $post_ID ) ), $labels->view_item ),
208
			2  => __( 'Custom field updated.', 'pods' ),
209
			3  => __( 'Custom field deleted.', 'pods' ),
210
			4  => sprintf( __( '%s updated.', 'pods' ), $labels->singular_name ),
211
			/* translators: %s: date and time of the revision */
212
			5  => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'pods' ), $labels->singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
213
			6  => sprintf( __( '%1$s published. <a href="%2$s">%3$s</a>', 'pods' ), $labels->singular_name, esc_url( get_permalink( $post_ID ) ), $labels->view_item ),
214
			7  => sprintf( __( '%s saved.', 'pods' ), $labels->singular_name ),
215
			8  => sprintf( __( '%1$s submitted. <a target="_blank" href="%2$s">Preview %3$s</a>', 'pods' ), $labels->singular_name, esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ), $labels->singular_name ),
216
			9  => sprintf(
217
				__( '%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>', 'pods' ), $labels->singular_name,
218
				// translators: Publish box date format, see http://php.net/date
219
				date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink( $post_ID ) ), $labels->singular_name
220
			),
221
			10 => sprintf( __( '%1$s draft updated. <a target="_blank" href="%2$s">Preview %3$s</a>', 'pods' ), $labels->singular_name, esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ), $labels->singular_name ),
222
		);
223
224
		if ( false === (boolean) $post_type->public ) {
225
			$messages[ $post_type->name ][1] = sprintf( __( '%s updated.', 'pods' ), $labels->singular_name );
226
			$messages[ $post_type->name ][6] = sprintf( __( '%s published.', 'pods' ), $labels->singular_name );
227
			$messages[ $post_type->name ][8] = sprintf( __( '%s submitted.', 'pods' ), $labels->singular_name );
228
			$messages[ $post_type->name ][9] = sprintf(
229
				__( '%s scheduled for: <strong>%1$s</strong>.', 'pods' ), $labels->singular_name,
230
				// translators: Publish box date format, see http://php.net/date
231
				date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) )
232
			);
233
			$messages[ $post_type->name ][10] = sprintf( __( '%s draft updated.', 'pods' ), $labels->singular_name );
234
		}
235
236
		return $messages;
237
	}
238
239
	/**
240
	 * Enqueue styles
241
	 *
242
	 * @since 2.0
243
	 */
244
	public function admin_assets() {
245

components/Templates/Templates.php 1 location

@@ 168-212 (lines=45) @@
165
	 * @return array
166
	 * @since 2.0.2
167
	 */
168
	public function setup_updated_messages( $messages ) {
169
170
		global $post, $post_ID;
171
172
		$post_type = get_post_type_object( $this->object_type );
173
174
		$labels = $post_type->labels;
175
176
		$messages[ $post_type->name ] = array(
177
			1  => sprintf( __( '%1$s updated. <a href="%2$s">%3$s</a>', 'pods' ), $labels->singular_name, esc_url( get_permalink( $post_ID ) ), $labels->view_item ),
178
			2  => __( 'Custom field updated.', 'pods' ),
179
			3  => __( 'Custom field deleted.', 'pods' ),
180
			4  => sprintf( __( '%s updated.', 'pods' ), $labels->singular_name ),
181
			/* translators: %s: date and time of the revision */
182
			5  => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'pods' ), $labels->singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
183
			6  => sprintf( __( '%1$s published. <a href="%2$s">%3$s</a>', 'pods' ), $labels->singular_name, esc_url( get_permalink( $post_ID ) ), $labels->view_item ),
184
			7  => sprintf( __( '%s saved.', 'pods' ), $labels->singular_name ),
185
			8  => sprintf( __( '%1$s submitted. <a target="_blank" href="%2$s">Preview %3$s</a>', 'pods' ), $labels->singular_name, esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ), $labels->singular_name ),
186
			9  => sprintf(
187
				__( '%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>', 'pods' ), $labels->singular_name,
188
				// translators: Publish box date format, see http://php.net/date
189
				date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink( $post_ID ) ), $labels->singular_name
190
			),
191
			10 => sprintf( __( '%1$s draft updated. <a target="_blank" href="%2$s">Preview %3$s</a>', 'pods' ), $labels->singular_name, esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ), $labels->singular_name ),
192
		);
193
194
		if ( false === (boolean) $post_type->public ) {
195
			$messages[ $post_type->name ][1] = sprintf( __( '%s updated.', 'pods' ), $labels->singular_name );
196
			$messages[ $post_type->name ][6] = sprintf( __( '%s published.', 'pods' ), $labels->singular_name );
197
			$messages[ $post_type->name ][8] = sprintf( __( '%s submitted.', 'pods' ), $labels->singular_name );
198
			$messages[ $post_type->name ][9] = sprintf(
199
				__( '%s scheduled for: <strong>%1$s</strong>.', 'pods' ), $labels->singular_name,
200
				// translators: Publish box date format, see http://php.net/date
201
				date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) )
202
			);
203
			$messages[ $post_type->name ][10] = sprintf( __( '%s draft updated.', 'pods' ), $labels->singular_name );
204
		}
205
206
		return $messages;
207
	}
208
209
	/**
210
	 * Enqueue styles
211
	 *
212
	 * @since 2.0
213
	 */
214
	public function admin_assets() {
215