Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Camo Image Proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WP Plugins
Camo Image Proxy
Merge requests
!4
WIP: Initial release
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
WIP: Initial release
develop
into
master
Overview
0
Commits
18
Pipelines
29
Changes
2
Merged
Erick Hitter
requested to merge
develop
into
master
6 years ago
Overview
0
Commits
18
Pipelines
29
Changes
2
Expand
Fixes
#1
0
0
Merge request reports
Viewing commit
04f20145
Prev
Next
Show latest version
2 files
+
48
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
04f20145
Prepare for content rewrites
· 04f20145
Erick Hitter
authored
7 years ago
inc/class-rewrite-content.php
+
43
−
0
Options
<?php
/**
* Rewrite images in content
*
* @package Camo_Image_Proxy
*/
namespace
Camo_Image_Proxy
;
/**
* Class Rewrite_Content
*/
class
Rewrite_Content
{
use
Singleton
;
/**
* Filter priority
*
* @var int
*/
private
$priority
;
/**
* Hooks
*/
public
function
setup
()
{
$priority
=
apply_filters
(
'camo_image_proxy_rewrite_content_priority'
,
PHP_INT_MAX
-
1
);
$this
->
priority
=
absint
(
$priority
);
add_filter
(
'the_content'
,
[
$this
,
'filter_the_content'
],
$this
->
priority
);
}
/**
* Rewrite image URLs in content
*
* @param string $content Post content.
* @return string
*/
public
function
filter_the_content
(
string
$content
)
:
string
{
// TODO: only deal with image srcs, use DOM Document.
return
$content
;
}
}
Loading